Hi
I modified the LineChartDemo and create my own createDataset()method
It works fine.
//init mydata
Vector data = {"..."}
...
CategoryDataset createDataset(Vector data) {
//Read elements from Vector and addValue to the table
dataset.addValue(value,series,x-axis-label);
return dataset;
}
My question is that the lineChartDemo display all the x-axis-label
while I don't want so many.
I only need 1 every 5 x-axis labels displayed so that it would not seem too crowded.
eg.
the orginal x-axis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15...>
what I expect
1----- 5-------10--->
Is there any method in the JFreeChar Libery to hide the extra x-axis label?Thank you.
How to hide the x-axis label periodically
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
If your x-axis contains numbers or dates, then you should use charts based on XYPlot rather than CategoryPlot. As a starting point, look at the createXYLineChart() method in the ChartFactory class.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 22
- Joined: Thu Jan 29, 2004 8:28 pm
Hiding the extra x-axis labels
Seems I'm in need of similar task, as in:
http://www.jfree.org/phpBB2/viewtopic.p ... gory+label
Any suggestions? Thanks.
http://www.jfree.org/phpBB2/viewtopic.p ... gory+label
Any suggestions? Thanks.