1

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

CarlJohn
  • 727
  • 2
  • 9
  • 20

1 Answers1

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

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Thanks for your help. Now i'm able to get first 15 records, but the tick marks& labels are generated for all records in X-axis. I want to restrict the ticks also to 15 count.. – CarlJohn Jun 19 '13 at 04:06
  • Please edit your question to include an [sscce](http://sscce.org/) that exhibits the problem you describe. – trashgod Jun 19 '13 at 08:30