SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
I’m using the RubberBandXyZoomModifier and DataPointSelectionModifier together from the left mouse button; enabling and disabling them based on the left CTRL key being pressed (CTRL key down = select).
I’m seeing what I assume to be a focus issue on first mousing over off the chart area in that the chart area doesn’t attract focus, and thus recognise the ctrl key press, until there’s been a mouse button click. I’ve created an app to demonstrate and attached the XAML and code behind for it.
To see the behaviour, run the code and press the “does nothing” button to set focus to it. Mouse over the chart and press the CTRL key – the key press is not recognised. Click the left mouse button and the key press is now recognised. So far so good.
Now if you repeat the process but click and drag – the logic is caught between the two modifiers being enabled/disabled and the zoom selection is shown even though the CTRL key is down. There are other issues e.g. CTRL down and drag outside the chart can leave the selection modifier drag area marked on the chart while the zoom mode is in operation
I was thinking of something like setting focus or forcing a mouse click in response to the mouse over event but so far my attempts have failed – probably from doing the wrong thing in the wrong place – so, as usual, any and all suggestions are most welcome!
I’m playing with the DatPointSelectionModifier which seems mostly what i need but I have two problems as follows:
1/ I have started a selection operation by dragging over an area containing some points and I decide that I don’t want that area after all and want to cancel the operation (much like file explorer file dragging – hitting escape cancels the operation) – How do I do that?
2/ I have a set of selected points and drag to select another set which overlaps the first set. I would like the any points in the overlap to invert from selected to unselected and vice versa. How would I know which points are encompassed by the drag operation so i can work out the overlap?
Thanks for any suggestions
Here’s the situation:
Our app has a viewmodel with an XyDataSeries Property bound to the plot. We’ve overridden DataPointSelectionModifer to allow us to trigger calculations when the selected points are changed. This overridden modifier is not instantiated by nor is it directly aware of the viewmodel; it is referenced only in the view xaml.
When changing between datasets we replace the contents of the XyDataSeries Property. Afterwards we are experiencing NullReferenceExceptions in DataPointSelectionModifier.SelectManyPoints(). This occurs whether we replace the contents of the data series or we set a completely new XyDataSeries object into the property.
It appears that the DataPointSelectionModifier.SelectedPointMarkers collection is no longer properly synced to the plot’s XyDataSeries. The size of the the collections are different and with the original DataSeries being garbage-collected the DataPointInfo.DataPointMetadata references are null. So we attempt to dial in a new selection and the deselection of this orphaned null metadata raises exceptions.
Is there some secret-sauce to keeping these collections in line?
Any and all suggestions are greatly appreciated.