Reputation: 223
I am trying to change the line thickness in some jfreechart graphs; in case of XY graphs, I am using the following code:
chartPanel.getChart().getXYPlot().getRenderer().setSeriesStroke(i, new BasicStroke(2.0f));
and it works properly. In case of polar graphs I tried the following code:
PolarPlot plot = (PolarPlot) chartPanel.getChart().getPlot();
DefaultPolarItemRenderer renderer = (DefaultPolarItemRenderer) plot.getRenderer();
renderer.setSeriesStroke(i, new BasicStroke(2.0f));
but it does not work, the line thickness is always the same. Do you have a clue?
Upvotes: 2
Views: 708
Reputation: 223
At the end I sorted out the problem. My code was correct and the problem was not the line thickness but the rounded bullets that jfreechart puts (by default) in every point of the polar diagram. The points were very closed to each other and the bullets made the effect of a very thick line! To remove them I used the following code:
renderer.setShapesVisible(false);
Upvotes: 1