Pre loader

DataPointSelectionModifier does not work if XAxes are two axes

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

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?

Version
v5.1.1 Build 11473
  • You must to post comments
0
0

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.

  • You must to post comments
1
1

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.

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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);
        }
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies