Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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?

Axes chart Data drawn reflect scales
0
Posted

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?

0
10

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); . . .

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123