We’re currently using the DataPointSelectionModifier which works great, however, we need some slight tweaks to it’s behaviour
- The ability to disable marquee selection on demand (whilst still being able to multi select points by clicking each point)
- Swap the Ctrl/Shift key combos
I was wondering if the source for the DataPointSelectionModifier could be made available for people to adapt to suit their needs? else it means trying to create it from scratch.
Perhaps you could post it in an area that only customers could access?
- Ben Green asked 8 months ago
- last edited 8 months ago
- You must login to post comments
Good questions
Making the modifier source open is not a problem however splitting up packages in the library is the challenge here – sharing or open sourcing the modifiers without making it a breaking change and managing versioning for maintenance.
If you set the property DataPointSelectionModifier.AllowsMultiSelection = false
this will disable both rectangle and ctrl multi select.
Next, you will need to override GetSelectionMode() to change the behaviour.
// Inherit DataPointSelectionModifier & override GetSelectionMode
// This is OUR implementation
protected virtual SelectionMode GetSelectionMode(MouseModifier modifierKey, bool isAreaSelection)
{
var selectionMode = SelectionMode.Replace;
// Remove this if block
if (!AllowsMultiSelection)
{
return selectionMode;
}
// Change behaviour here to return SelectionMode.Union, Inverse or Replace depending on what you want
if (modifierKey == MouseModifier.Ctrl)
{
selectionMode = isAreaSelection ? SelectionMode.Union : SelectionMode.Inverse;
}
else if (modifierKey == MouseModifier.Shift)
{
selectionMode = SelectionMode.Inverse;
}
return selectionMode;
}
So long as the above returns SelectionMode.Union, even if AllowsMultiSelection is false, the modifier should let you CTRL click multiple points.
Does this help?
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 months ago
- You must login to post comments
Thank you Andrew, I’ll give that a shot.
If it is tricky to make the live version opensource, maybe you could just opensource the current version as it stands now as copy into an example project (i.e so you don’t have to maintain it), it would still be super helpful to understand how everything hooks up.
- Ben Green answered 8 months ago
- last edited 8 months ago
- You must login to post comments
Hi Ben,
Thanks for your inquiry.
Let me suggest you considering the upgrade to the source code license type.
It will give you the full access to SciChart sources.
For more details, you can contact our Sales here:
https://www.scichart.com/contact-us/
Or email us at [email protected]
With best regards,
Lex
SciChart Technical Support Engineer
- Lex answered 8 months ago
- last edited 8 months ago
- You must login to post comments
Please login first to submit.