Pre loader

ChartModifer in Style

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

Hello,
I just want to override the ChartModifier property in the style

I have tree charts one after the other and only the last chart has a legend. It seems I cannot use a style with the same key multiple times.

<Style x:Key="ChartWithMyModifiers" TargetType="{x:Type s:SciChartSurface}">
    <Setter Property="ChartModifier">
        <Setter.Value>
            <s:ModifierGroup>
                <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
                <s:YAxisDragModifier DragMode="Scale"/>
                <s:XAxisDragModifier DragMode="Scale"/>
                <s:MouseWheelZoomModifier/>
                <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                <s:LegendModifier ShowLegend="True"/>
            </s:ModifierGroup>
        </Setter.Value>
    </Setter>
</Style>

The result screen is attached.
Thanks, Gabor

Version
6.3.0.13476
Images
  • You must to post comments
1
0

Hi Andrew,
Thank your for your tip. I cannot use Shared on a style but an object it was a perfect solution.

 

Thanks for your help, Gabor

  • You must to post comments
1
0

Hi Laszlo,

This is a WPF limitation not a scichart one. The problem is a single instance of the style and it’s contents are applied to all charts. So you have one ZoomPanModifier attached to many charts.

You can try setting

<Style x:Shared="false">...

which will force one style instance per chart it’s applied to

  • You must to post comments
Showing 2 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