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
- László Géczi asked 1 month ago
- You must login 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
- Andrew Burnett-Thompson answered 1 month ago
- You must login 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
- László Géczi answered 1 month ago
- last edited 1 month ago
- You must login to post comments
Please login first to submit.