Created
January 28, 2014 23:11
-
-
Save edpichler/8678605 to your computer and use it in GitHub Desktop.
Changing the line size of a JFreeChart chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private JFreeChart createChart(XYDataset dataset, ICarteira car) { | |
// create the chart... | |
final JFreeChart chart = ChartFactory.createTimeSeriesChart( | |
car.getNome(), // title | |
"Tempo", // x axis label | |
"Valor", // y axis label | |
dataset, // data | |
true, // include legend | |
true, // tooltips | |
true // urls | |
); | |
XYPlot plot = chart.getXYPlot(); | |
// here we change the line size | |
int seriesCount = plot.getSeriesCount(); | |
for (int i = 0; i < seriesCount; i++) { | |
plot.getRenderer().setSeriesStroke(i, new BasicStroke(2)); | |
} | |
// line size changed | |
return chart; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment