Using JFreeChart Scatter Plots is there a Way to Subdivide Styles for Data Sets?

吃可爱长大的小学妹 提交于 2019-11-26 08:38:06

问题


I am using JFreeChart to render a scatter plot with a couple thousand data points. I control the appearance/style of each ScatterPlotDataset by attaching a suitable XYLineAndShapeRendererper to each data set; eg. points in data set 1 appear as circles and points in data set 2 appear as squares. I would like the user to be able to dynamically assign a sub-style per point in each data set; eg. if the data set were books then the user might wish to color fiction blue and nonfiction red. Is there a way to do this without defining a new data set for each sub style?

Incidentally I am carting with XYPlot but I can switch to another chart type if necessary.

Thank you in advance.


回答1:


You might consider the approaches mentioned here. The first implements DrawingSupplier; the second extends DefaultDrawingSupplier to achieve a similar effect. Of course, you can always override getItemPaint(), as shown here.



来源:https://stackoverflow.com/questions/16752852/using-jfreechart-scatter-plots-is-there-a-way-to-subdivide-styles-for-data-sets

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