How do I update my data, and auto-rescale the chart scales and axes to reflect the new data, after it has already been drawn?
Updating data was discussed in FAQ # 6. If you want the chart to rescale based on the new data, call the appropriate coordinate systems auto-scale method, followed by the auto-axis methods of all related axes. Then call the ChartView.updateDraw method. For example: // Create the ChartView object to place graph objects in. TimeSimpleDataset Dataset1 = new TimeSimpleDataset(“Sales”,x1,y1); TimeCoordinates simpleTimeCoordinates = new TimeCoordinates(); simpleTimeCoordinates.autoScale(Dataset1, ChartConstants.AUTOAXES_FAR , ChartConstants.AUTOAXES_FAR); ChartView chartVu = new ChartView(); // Create the time axis (x-axis is assumed) TimeAxis xAxis = new TimeAxis(simpleTimeCoordinates); // Create the linear y-axis LinearAxis yAxis = new LinearAxis( simpleTimeCoordinates, ChartConstants.Y_AXIS); . . .