Why FreeChart is so tardiness?
Why FreeChart is so tardiness?
I try to put about 100 value in LineChart. But it is so slowness! What am I wrong?
Re: Why FreeChart is so tardiness?
Hi Qiao Jian-nan,
I'm not sure, you don't give me much to go on. If you create the chart with an empty dataset, then add each value the chart will be redrawn each time you add a value (so you might be redrawing the chart 100 times). Better to create the dataset first, then the chart.
Aside from that, if you post some code and tell me how long it takes to draw the chart, plus:
- the JFreeChart version you are using;
- the JDK version you use;
- the operating system;
- your computer's CPU speed;
- available RAM;
...then I can take a guess at whether the speed is out of line with expectations.
Regards,
Dave Gilbert
I'm not sure, you don't give me much to go on. If you create the chart with an empty dataset, then add each value the chart will be redrawn each time you add a value (so you might be redrawing the chart 100 times). Better to create the dataset first, then the chart.
Aside from that, if you post some code and tell me how long it takes to draw the chart, plus:
- the JFreeChart version you are using;
- the JDK version you use;
- the operating system;
- your computer's CPU speed;
- available RAM;
...then I can take a guess at whether the speed is out of line with expectations.
Regards,
Dave Gilbert
Re: Why FreeChart is so tardiness?
Thank you. I've solved my question.
I try these words:
CategoryPlot plot = chart.getCategoryPlot();
// change the category labels to vertical...
HorizontalCategoryAxis domainAxis = (HorizontalCategoryAxis) plot.getDomainAxis();
domainAxis.setSkipCategoryLabelsToFit(true);
When the last line added, it is ok.
I try these words:
CategoryPlot plot = chart.getCategoryPlot();
// change the category labels to vertical...
HorizontalCategoryAxis domainAxis = (HorizontalCategoryAxis) plot.getDomainAxis();
domainAxis.setSkipCategoryLabelsToFit(true);
When the last line added, it is ok.