JFreechart-如何设置域轴范围? [英] JFreechart - How to set Domain Axis range?

查看:48
本文介绍了JFreechart-如何设置域轴范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JFreechart的新手.我有一个包含更多记录(> 50)的数据集,即(X值是产品而Y轴是数量),在图表中我只想在X轴上显示前15条记录.我正在使用CategoryAxis之类的.

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

推荐答案

这似乎不是轴问题.一个简单的权宜之计就是只添加所需的记录,但是

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

这篇关于JFreechart-如何设置域轴范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆