Hello,
I am trying to figure out how to get the chart from displaying 161.000000 in the values bar. I am using a BasicTimeSeries, and adding values using 'series.add(new Week(week, year), new Integer(tempW));' which should insert it as an integer, but it isn't helping. After I have the series, I make a TimeSeriesCollection, and use that in the graph.
any help would be appreciated...
thanks,
Reid Maker
rmaker@cs.brandeis.edu
rounding on timeseries
Re: rounding on timeseries
The number axis uses a collection of 'standard' tick units, and automatically selects one that should be appropriate for the axis range. By default, the collection returned by the TickUnits.createStandardTickUnits() method is used - this includes tick units with decimal precision.
If your data contains only integers, then a better collection to use is the one returned by the TickUnits.createIntegerTickUnits() method (or you can create your own collection). Do something like this:
XYPlot plot = myChart.getXYPlot();
NumberAxis axis = (NumberAxis)plot.getRangeAxis();
TickUnits ticks = TickUnits.createIntegerTickUnits();
axis.setStandardTickUnits(ticks);
Regards,
DG.
If your data contains only integers, then a better collection to use is the one returned by the TickUnits.createIntegerTickUnits() method (or you can create your own collection). Do something like this:
XYPlot plot = myChart.getXYPlot();
NumberAxis axis = (NumberAxis)plot.getRangeAxis();
TickUnits ticks = TickUnits.createIntegerTickUnits();
axis.setStandardTickUnits(ticks);
Regards,
DG.