Is it possible to have two (X and Y) CategoryAxes in JFreeChart?

一曲冷凌霜 提交于 2019-12-13 18:48:11

问题


I am creating a correlation matrix in JFreeChart. I'm nearly done except that both axes have number values (i: say 1 to 20). I use DefaultXYZDataset and a customized BlockRenderer with a overridden PaintScale Class. The value z itself is represented by the colour of a filled rectangle at the positions (x,y) in ([1 to 20], [1 to 20]).

Is it possible to replace the axis labels on X and Y by a String e.g. names[i]? To achieve this, have I to change the NumberAxes into CategoryAxes? Both axes needed to be categorical since I need coordinates like ("ParameterA", "ParameterB"). I guess i would need a special renderer then and the whole code had to be modified. On first sight this isn't even possible. I didn't found a suitable Dataset for that task.

Or could i simply change some kind of tick label format?


回答1:


SymbolAxis, illustrated here, is a NumberAxis and might be a suitable choice.



来源:https://stackoverflow.com/questions/14335681/is-it-possible-to-have-two-x-and-y-categoryaxes-in-jfreechart

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