title: JFreeChart Legend Display
body: <p>In my JFreeChart timeseries plots I find the legends lines too thin to see the colour accurately. Another post [ https://stackoverflow.com/questions/7306901/jfreechart-change-sample-of-colors-in-legend ]
  suggested overriding a renderer method as follows:</p>
  <pre><code>renderer = new XYLineAndShapeRenderer()
  {
      private static final long serialVersionUID = 1L;
      public Shape lookupLegendShape(int series)
      {
          return new Rectangle(15, 15);
      }
  };
  </code></pre>
  <p>this approach works fine until you do what I did</p>
  <pre><code>renderer.setSeriesShapesVisible(i, false);
  </code></pre>
  <p>Once I did that the legend reverts back to a line. Is there any way round this?</p>
  <p><strong>The solution I adopted is close to that suggested by TrashGod</strong>  I overrode the getLegendItem() method, forcing the legend shape to the desired box.</p>
  <pre><code>    renderer = new XYLineAndShapeRenderer()
      {
          private static final long serialVersionUID = 1L;
  
          public LegendItem getLegendItem(int datasetIndex, int series)
          {
              LegendItem legend = super.getLegendItem(datasetIndex, series);
              return new LegendItem(legend.getLabel(), legend.getDescription(), legend.getToolTipText(), legend.getURLText(), Plot.DEFAULT_LEGEND_ITEM_BOX, legend.getFillPaint());
          }
      };
  </code></pre>