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


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">
                <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
                <s:YAxisDragModifier DragMode="Scale"/>
                <s:XAxisDragModifier DragMode="Scale"/>
                <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                <s:LegendModifier ShowLegend="True"/>

The result screen is attached.
Thanks, Gabor

  • You must to post comments

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

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
Showing 2 results
Your Answer

Please first to submit.