I’m trying to enable the use of multiple VerticalLineAnnotations and show the corresponding SeriesInfo in an extra legend to the user. Utilizing the RolloverModifier Tooltips example, this works quite easily for the position and values of the VerticalLineAnnotations. However, I would like to show differences (X and Y) between the values of two VerticalLineAnnotations in the same manner.
My approach was to subclass ChartDataObject and add an ObservableCollection of a custom class (SeriesDifferenceInfo) providing properties, which exhibit DeltaX and DeltaY for binding in the surface. For keeping this collection up to date when adding or removing a VerticalLineAnnotation, I registered for the CollectionChanged event of SeriesInfo in my subclassed ChartDataObject and wanted to update the Collection of SeriesDifferenceInfo subsequently. But somehow this event appears not to be triggered on a change in the list of SeriesInfo. Am I doing something wrong or is this intended behaviour? Of course, I could simply call a method UpdateDifferenceCollection(), when adding/removing a VerticalLineAnnotation, but is this really neccessary?
Also, the next problem is triggering PropertyChanged for the DeltaX and DeltaY values when the values of one SeriesInfo changed. I guess this could be done by listening to e.g. a drag event of VerticalLineAnnotation, but is there a more straightforward way to do this?
- Ok, I tried using the _propertyChanged event in the subclassed ChartDataObject as an update trigger (for adding/removing VerticalLineAnnotations and also just moving). This would actually do what I want/need, but SeriesInfo is updated all the time the mouse moves on the surface, so capturing this event gives an unreasonably high cpu load.
- You must login to post comments