Eugene Shmorgun
Eugene Shmorgun

Reputation: 2065

How to change shape of elements in the legend - jFreeChart?

How I can change the shape of elements of legend for jFreeChart without changing the graphs of diagrams ?

enter image description here

I have ready time series diagram. I need to update the existed data markers in legend to the simple line with defined colors.

Upvotes: 2

Views: 2366

Answers (1)

trashgod
trashgod

Reputation: 205785

Start by not adding a LegendTitle to your chart. This is usually a controlled by a parameter to your ChartFactory or your JFreeChart constructor. Both CategoryPlot and XYPlot have a setFixedLegendItems() method, mentioned here, that you can use to add a collection of arbitrary legend items.

Upvotes: 2

Related Questions