The X axis was set to two axes as follows.
<s:SciChartSurface.XAxes>
<s:NumericAxis DrawMajorBands="True"
FlipCoordinates="True"
GrowBy="0.1, 0.1"
Id="Time1" />
<s:NumericAxis DrawMajorBands="True"
FlipCoordinates="True"
GrowBy="0.1, 0.1"
Id="Time2" />
</s:SciChartSurface.XAxes>
We wanted to make it selectable with DataPointSelectionModifier for two axes, so we set as follows.
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
<s:DataPointSelectionModifier Name="PointMarkersSelectionModifier"
IncludeSeries="False"
IsEnabled="True"
SelectionFill="#B1B5B2B2"
SelectionStroke="#009E9C9C"
XAxisId="Time1" />
<s:DataPointSelectionModifier Name="PointMarkersSelectionModifier2"
IncludeSeries="False"
IsEnabled="True"
SelectionFill="#B1B5B2B2"
SelectionStroke="#009E9C9C"
XAxisId="Time2" />
<s:MouseWheelZoomModifier IsEnabled="True" />
<s:RubberBandXyZoomModifier IsEnabled="False" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
However, only XAxisId = “Time 1” works correctly.
How can we make two axes selectable?
- Kenichi Kobayashi asked 6 years ago
-
Good question, we’ll investigate
- You must login to post comments
Hello Kenichi Kobayashi,
Thank you for reporting this,
I have tried your sample and it seems that’s modifier group is overrided by the SciChartInteractionToolbar and it adds just one DataPointSelectionModifier.
To get your sample to work all you have to do is just to comment out\remove SciChartInteractionToolbar from your window. I mean you better have to specify all modifiers that you need manually and not by the interactionToolbar.
I’ve tested it on our side and seems that it solves the problem, can you try the same and give us your feedback does it work on your side?
By the way SciChartInteractionToolbar is open source control you can customize it as much as want to.
- Nazariy Pelyushkevych answered 6 years ago
-
Side note: have a look at THIS POST about why you should not use SciChart.Examples.ExternalDependencies.dll and if you want to use the open-source SciChartInteractionToolbar then you really must use the source-code version. https://www.scichart.com/questions/question/how-to-use-scichartinteractiontoolbar-in-my-application
- You must login to post comments
Just thinking about this, with no easy way to test this, but have you tried setting ReceiveHandledEvents to true on PointMarkersSelectionModifier2? The second instance might just never get the mouse events to do its job…
Mike.
- Michael Dusoe answered 6 years ago
- You must login to post comments
We tried with ReceiveHandledEvents set to True, but PointMarkersSelectionModifier2 did not work.
There is “SciChart_PointMarkersSelection.csproj” in the sample project of SCIChart.
I attached a project that modified the project’s X axis to two axes.
I selected the range of pink color, but I could not select the point of the chart on Time 2 axis.
Please tell me how to resolve.
- Kenichi Kobayashi answered 6 years ago
- last edited 6 years ago
- You must login to post comments
Thank you for your reply.
And getting the code of SciChart.Examples.ExternalDependencies from GitHub and customizing the OnCreateModifiers section.
Before:
foreach (var exampleMod in exampleModifiers.ChildModifiers.Where(x => GetAppearceInToolbar((ChartModifierBase)x)))
{
if (HasToAddUserModifierToModifierGroup(exampleMod, devMods))
{
devMods.ChildModifiers.Add(exampleMod);
}
if (HasToAddUserModifierToModifierGroup(exampleMod, userMods))
{
userMods.ChildModifiers.Add(exampleMod);
}
}
After:
foreach (var exampleMod in exampleModifiers.ChildModifiers.Where(x => GetAppearceInToolbar((ChartModifierBase)x)).Where(a => HasToAddUserModifierToModifierGroup(a, devMods)).ToList())
{
devMods.ChildModifiers.Add(exampleMod);
}
foreach (var exampleMod in exampleModifiers.ChildModifiers.Where(x => GetAppearceInToolbar((ChartModifierBase)x)).Where(a => HasToAddUserModifierToModifierGroup(a, userMods)).ToList())
{
userMods.ChildModifiers.Add(exampleMod);
}
- Kenichi Kobayashi answered 6 years ago
- You must login to post comments
Please login first to submit.