我正在使用JFreeChart,我想只有一个维度的图表: 一个x轴(表示毫秒)和形状(表示事件)。JFreeChart:一轴分布图
我创建了一个XYLineChart和具有隐藏y轴的XYPlot:
this.chart = ChartFactory.createXYLineChart(
"","","",dataset,PlotOrientation.VERTICAL, false, true,false);
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
plot.setRangeGridlinesVisible(false);
plot.setDomainCrosshairVisible(true);
plot.setRangeCrosshairVisible(false);
NumberAxis range = (NumberAxis) plot.getRangeAxis();
range.setVisible(false);
range.setRange(0.0, 1.0);
range.setTickUnit(new NumberTickUnit(0.5));
在我使用的固定y坐标的数据集。
我得到这个结果:
image 1 http://imageshack.us/a/img46/4935/pointsuw.jpg
,但我想有这样的事情:
image 2 http://img521.imageshack.us/img521/3721/points2.jpg
如果我只是调整面板,整个图表的大小(标题,数字,形状)。 所以我想只调整“灰色区域”。
显然,如果存在另一个适当的图表类型,则会更好。
非常感谢。
请编辑您的问题包括[SSCCE(http://sscce.org/)所示的方法之一,它实现[这里](http://stackoverflow.com/a/10277372/230513 )。 – trashgod 2013-05-03 02:08:55