I would like to UP this subject. OK, I will try to send a photo when possible. Little explanation. Imagine a race with laps and some sensor measurements.
We have sensor measurements for each lap. Data like distance, GPS position, speed, fuel consumption etc.
There are two charts visible in one moment MAX.
One is some data (speed, fuel consumption etc) on Y axis and distance in lap in X axis.
Second can be a chart with a map of the track with the positions for a given measurement or another (lets keep it simple).
The user can select the laps he wants to have displayed - different laps are different series with diferent colors.
The user can also select a point of interest on one of the two series so it can be targeted and then some additional info can be displayed.
Mainly when a user selects a point from chart A we want to select a point on chart B.
Currently there a couple of problems with this.
- The user selects a couple of laps, deselects etc - the data is loaded froma a database -> how to synchronize this loading?
The main problem is that a point can be already selected for LAP1, then for each other of the laps another point is calculated with respect to the user selected point. If he loads another lap the point should be added for that loadel lap -> or removed if a lap is deselected.
Finally the lap containing the selected point will be removed from the grid and an index always has to be rememberd (SChartDataPoint has only a public readonly index -> i had to subclass it and add my own customIndex so i can set it from my function is there a better way?).
Sometimes when user is anxious the datasource and current selection/Annpotation adding gest out of sync and array out bounds is thrown.
- How to synchronize these views -> lap loading and annotation adding? Is there a good pattern for this? Wait for chart rendering before adding annotations? or how this should be done? Can this be done asyncchronusely? We want the user to have the best Expierience of responsive fast and smooth Charts.
Thank you in advance, i Wil lbe gratefull for any help on this topic.