title: jfreechart - change sample of colors in legend
body: <p>Can someone tell me how to change samples of series color in legend in jfreechart. What I have now is small line of series color eg:<br><img src="https://i.stack.imgur.com/JraeU.png" alt="Example"> <br>I would like to have square sample of those colors. Here is an example<br><img src="https://i.stack.imgur.com/wigf6.png" alt="Example"></p>
  
  <p>Can someone help me?</p>
  
  <p>Ok I found the solution. At least I think. Of course there is no simple way to do this. There is now, you know, setShape(square) method, that will do the trick, at least i haven't found one. </p>
  
  <p>Basicly XY chart and time chart have "line style" legend by default in contrary to bar chart for example (if has square legend by default). So I had to remove current legend and create new one with square samples of color and this new legend add to my time chart.</p>
  
  <pre><code>LegendItemCollection legend = new LegendItemCollection();    
  for (int i = 0; i &lt; seriecCount; ++i) {
      chart.getXYPlot().getRenderer().setSeriesPaint(i, colorPalette.get(i));
      LegendItem li = new LegendItem(data.getSeriesName(i), "-", null, null, Plot.DEFAULT_LEGEND_ITEM_BOX, colorPalette.get(i));
      legend.add(li);
  }  
  chart.getXYPlot().setFixedLegendItems(legend);
  </code></pre>
  
  <p>Thanks for attention. I hope it will help someone.</p>