I'm using JFreeChart and I'd like have a Chart with one dimension only: a x-axis (that indicates milliseconds) and shapes (that rapresents events).
I created a XYLineChart and a XYPlot with hidden y-axis :
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));
In the dataset I used a fixed y-coordinate.
I obtained this result:
image 1 http://imageshack.us/a/img46/4935/pointsuw.jpg
But I'd like have something like this:
If I simply resize the Panel, the entire chart is resized (title, numbers, shapes). So I'd like resize the "grey area" only.
Obviously it's better if another and appropriate chart type exist.
Thanks a lot.