Set color for border of legend of JFree Chart

99封情书 提交于 2019-12-07 17:24:48

问题


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.


回答1:


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

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



来源:https://stackoverflow.com/questions/15163545/set-color-for-border-of-legend-of-jfree-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!