I am developing a Java applet to display some statistic data, and I use JFreeChart for visual presentations.
One of the statistics requires displaying up to 150 values in sequence.
I've tried using a regular line chart (ChartFactory.createLineChart), like for my other charts, but the result was unwatchable - labels are ovelapping labels and grid lines are way too close.
I've searched this forum, but all similar questions used dates in the domain axis, and thus could be resolved using Time Series. In my case, the domain axis contain strings. These strings are also a form of time, but think more like game turns and rounds than any standard date format.
I would like to display only a selected subset of the domain axis labels and grid lines - is there a way to do it?
Displaying a subset of domain's labels and grid lines.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Displaying a subset of domain's labels and grid lines.
I would probably represent the data on the x-axis using integers (turn 1, turn 2, ...) so that the data could be plotted on an XYPlot. Then I would subclass NumberAxis and override the refreshTicks() method to customise the tick labels that will appear on the x-axis.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Displaying a subset of domain's labels and grid lines.
Thanks, it worked. I lost some label formatting, when compared to CategoryPlot, but I guess this can be fixed after some tampering.