Search code examples
jfreechart

JFReeCharts XYPlot is it possible to change shapes inside legends


lt.setPosition(RectangleEdge.BOTTOM);
lt.setItemFont(old);
// get the range axis and add the $ symbol for the values
NumberAxis na = (NumberAxis) plot.getRangeAxis();       
// set font
na.setLabelFont(fAxisFont); 
na.setTickLabelFont(fAxisFont);
na.setAutoRange(true);

The above is my code snippet.Can anyone tell how to to chang shapes inside legends


Solution

  • A LegendItem infers its Shape from the corresponding series, which can be changed as shown here. This related example shows one way to render a LegendItem in an external component.

    image