问题
I'm newbie in JFreechart. I've a dataset which contains more records(>50 ) i.e (the X-values are products and Y-Axis are quantity) , in the chart i want to display only first 15 records in the X-axis. I'm using CategoryAxis like.
final CategoryPlot plot = chart.getCategoryPlot();
final CategoryAxis domainAxis = plot.getDomainAxis();
Anyone please guide me to do this.?
回答1:
This doesn't appear to be an axis problem. One simple expedient would be to add only the desired records, but SlidingCategoryDataset would allow you to setFirstCategoryIndex(0)
and setMaximumCategoryCount(15)
.
来源:https://stackoverflow.com/questions/17162417/jfreechart-how-to-set-domain-axis-range