How to set line thickness for multiple series in JFreeChart?

早过忘川 提交于 2019-12-10 20:23:56

问题


I create a lot of charts. In each of them I need to call

renderer.setSeriesStroke( i, new BasicStroke( 2.0f ) );

for each series. (renderer is chart.getXYPlot().getRenderer()).

I wonder if there is any way to set the thickness globally.


回答1:


Call the renderer's setBaseStroke() method, like they say here, and change the autoPopulateSeriesStroke flag, like they say here.

renderer.setBaseStroke(new BasicStroke(2.0f));
renderer.setAutoPopulateSeriesStroke(false);


来源:https://stackoverflow.com/questions/52890150/how-to-set-line-thickness-for-multiple-series-in-jfreechart

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