Jfreechart with scroller

柔情痞子 提交于 2019-12-02 12:53:50

The error message is pretty obvious:

org.jfree.data.xy.XYSeriesCollection cannot be cast to org.jfree.data.category.CategoryDataset

You are casting a XYSeriesCollection object to a CategoryDataset object, which does not work. Looking at the lines in the stack trace, it is caused by the following line

dataset = new SlidingCategoryDataset((CategoryDataset) createDataset(), 0, 10);

The createDataset() methods returns a XYSeriesCollection and not a CategoryDataset, so you cannot do this cast. Either adjust the return type of that method, or get rid of the cast

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