I use HorizontalDateAxis, VerticalNumberAxis, BasicTimeSeries, XYPlot.
When I add a value to BasicTimeSeries, the value was added at tail of the plot.
So recent data are located at most right position.
But I'd like to add a value at middle of the plot. Of couse current time is located at middle of the plot.
How can I solve this problem?
How can I draw a begging point at middle of plot?
Re: How can I draw a begging point at middle of plot?
It's not so easy, unless you want to manually set the axis range and adjust it every time you add a new value.
Or you could try setting the upper margin on the axis to a large percentage value, something like this:
XYPlot plot = myChart.getXYPlot();
ValueAxis domainAxis = plot.getDomainAxis();
domainAxis.setUpperMargin(0.50);
You might even be able to set the value to 1.0, I forget exactly how it calculates the margin. Take a look in the source code to see how it gets used...
Regards,
Dave Gilbert
Or you could try setting the upper margin on the axis to a large percentage value, something like this:
XYPlot plot = myChart.getXYPlot();
ValueAxis domainAxis = plot.getDomainAxis();
domainAxis.setUpperMargin(0.50);
You might even be able to set the value to 1.0, I forget exactly how it calculates the margin. Take a look in the source code to see how it gets used...
Regards,
Dave Gilbert