JFreechart - How to set Domain Axis range?

人盡茶涼 提交于 2021-02-19 08:12:51

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!