1
votes

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

1 Answers

1
votes

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).