JFreeChart中可以有两个(X和Y)CategoryAxes吗? [英] Is it possible to have two (X and Y) CategoryAxes in JFreeChart?

查看:62
本文介绍了JFreeChart中可以有两个(X和Y)CategoryAxes吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在JFreeChart中创建一个相关矩阵.除了两个轴都有数字值(我说1到20)之外,我几乎完成了.我将DefaultXYZDataset和自定义的BlockRenderer与重写的PaintScale类一起使用.值z本身由([1至20],[1至20])中位置(x,y)的填充矩形的颜色表示.

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

是否可以用字符串(例如)替换X和Y上的轴标签.名字[i]?为此,我是否要将NumberAxes更改为CategoryAxes?因为我需要像("ParameterA","ParameterB")这样的坐标,所以两个轴都需要分类.我想我那时需要一个特殊的渲染器,并且必须修改整个代码.乍看之下,这甚至是不可能的.我没有找到适合该任务的数据集.

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?

推荐答案

SymbolAxis (在此处所示)是NumberAxis,可能是一个合适的选择.

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

这篇关于JFreeChart中可以有两个(X和Y)CategoryAxes吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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