3

Problem is formulated in title. Details:

I have code in class-theme for set specific non-default-color for the border of legend frame.

LegendTitle legend = jFreeChart.getLegend();
legend.setWidth(100);

After this I need to set color for border of legend, but nothing like

legend.setBorderColor(Color.green)

I couldn't found.

Help me, please.

Thanks for replies.

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

1 Answers1

3

You can specify a new color when you replace the legend's border:

LegendTitle legend = chart.getLegend();
legend.setFrame(new BlockBorder(Color.green));

enter image description here

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Thanks a lot! Realy, you are the greatest expert in jasper report and jfreechart that I ever met in internet. Your help is very valuable for me. – Eugene Shmorgun Mar 06 '13 at 16:22
  • Please, check another my question http://stackoverflow.com/questions/15254385/setting-currency-format-for-labels-of-vertical-axis-in-jfreechart – Eugene Shmorgun Mar 06 '13 at 17:49