I m using Multipoint chart to show 2 graphs.
The first graphs shows 24 hours of data regarding the store temperature.
In this graphs, I have reading every 5 mins, making total 288 reading in 24 hours.
The X axis shows the time and Y shows the temperature reading.
The second graph shows when the reading was acknowledged in 24 hours and it has only 26 readings at random times of the day.
When I draw both graphs, my second graph shows all the readings in left side of the graph instead of showing on the right time according to the first graph (in 24 hour range)
The 2, X axes are not in sync. Hw can I sync the 2 graphs X axes?
If you do not use Layer.setXData, the x-coordinates are assumed to be the array index 0, 1, 2, 3 ... If the x-axis is configured with labels (Axis.setLabels), the labels will be assumed to be at 0, 1, 2, 3, ... too. So the data points will match the labels.
If you data points are not evenly spaced like in the second example above, you need to provide x-coordinates for all of your data series. Furthermore, you cannot use Axis.setLabels. (The labels are just names with no meaning to the computer, so they cannot be used as coordinates, and their coordinates will be assumed to be 0, 1, 2, 3 ...) You can choose not to configure the x-axis, in which case the x-axis will be automatically scaled and labelled similar to the y-axis. Alternative, you can configure the x-axis using Axis.setLinearScale, Axis.setLogScale or Axis.setDateScale.
Note that in any case, you would need to provide x-coordinates for your data (Layer.setXData should be used), and the x-axis must not be configured using labels (Axis.setLabels should not be used). You can let ChartDirector auto-scale the x-axis, or you can configure the x-axis scale of the first chart using Axis.setLinearScale or Axis.setDateScale.
If your code is based on the Real-Time MultiChart sample code, I found out there is a bug in the sample code. It does not affect the original sample code, but affect certain modification of the sample code.