Setting histogram breaks in JFreeChart

只愿长相守 提交于 2019-11-28 02:06:16

SimpleHistogramBin is a good choice for this, as it allows specifying the bin bounds. Add the resulting bins to a SimpleHistogramDataset for use with ChartFactory.createHistogram(). Invoke setAdjustForBinSize() as needed.

SimpleHistogramDataset data = new SimpleHistogramDataset("Time");
for (int i = 10; i < 70; i += 10) {
    data.addBin(new SimpleHistogramBin(i, i + 10, true, false));
}
data.setAdjustForBinSize(false);

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