2

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.

Eugene Shmorgun
  • 2,083
  • 12
  • 42
  • 67

1 Answers1

2

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.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Problem is that I have hardcoded legend in jrxml-file, and I can't to redefine something in legend, excluding the markers. – Eugene Shmorgun Apr 05 '13 at 13:11
  • I don't understand. Please update your question to reflect this requirement. – trashgod Apr 05 '13 at 14:09
  • I don't understand where you had trouble using the approach I suggested. Please edit your question to include an [sscce](http://sscce.org/). – trashgod Apr 05 '13 at 19:47
  • Thanks a lot for you comment - it led me to the right decision! Can you hint me something another problem ? http://stackoverflow.com/questions/15863515/barchart-text-trancation-problems – Eugene Shmorgun Apr 07 '13 at 14:33