Pre loader

PointMarkerTemplate not working

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 managed to be able to render the EllipsePointMarkers, but here is the thing: It only works when I declare the PointMarker in my view model inside the constructor of the XyScatterRenderableSeriesViewModel. The Style with the PointerMarkerTemplate is NOT APPLIED for some reason. Could this be a bug? Please note that in the following code in the view model I specify the color to be “Red” (ARGB(255, 255, 0, 0) but in xaml the template specifies yellow for the fill and stroke.

I absolutely need the PointMarker Template to work because I want to be able to change the color and thickness of the Scatter points during runtime via UI (function in my custom legend).

The following are code snippets from my view model and the corresponding xaml:

ChartSeries.Add(new XyScatterRenderableSeriesViewModel()
                    DataSeries = dataSeries,
                    //Stroke = color,
                    //StrokeThickness = 10,
                    IsVisible = isVisible,
                    AntiAliasing = useAntiAliasing,
                    IsSelected = isSelected,
                    XAxisId = "DateTimeAxis",
                    YAxisId = yAxisId,
                    PointMarker = new EllipsePointMarker()
                        Fill = Color.FromArgb(255, 255, 0, 0),
                        Stroke = Color.FromArgb(255, 255, 0, 0),
                        StrokeThickness = 5



    <Style TargetType="{x:Type s:XyScatterRenderableSeries}">
        <Setter Property="PointMarkerTemplate">
                    <s:EllipsePointMarker Fill="Yellow" Stroke="Yellow" StrokeThickness="15"/>

    <s:EffectConverter x:Key="EffectConverter"/>

    <DropShadowEffect x:Key="LegendDropShadow" BlurRadius="10" Direction="-45" ShadowDepth="5" Color="Black"/>

    <SolidColorBrush x:Key="LegendTextBrush"  Color="#5F5F5F"/>

    <resources:VisibilityToBooleanConverter x:Key="VisibilityToBooleanConverter"/>

    <resources:CustomCategoryDateTimeAxisLabelProvider x:Key="LabelProvider"/>

  • You must to post comments

There is a little known quirk in WPF called DependencyProperty Value Precedence. If any property is set in code, then the same property cannot be set by a style or a template, as the property set in code takes precedence over the style or template value.

PointMarkerTemplate is where we apply a template to a RenderableSeries
PointMarker is where we apply a PointMarker in code.

As a result, if you have set the PointMarker on a series, then the PointMarkerTemplate will no longer have an effect.


1/ Use only PointMarker for both setting in style and setting in code. If you set a PointMarker in a style, make sure that you use x:Shared = false on the style

           <Style TargetType="s:XyScatterRenderableSeries" x:Shared="False">
                  <Setter Property="PointMarker">
                                 <EllipsePointMarker Width="5" Height="5"/>

2/ Use only PointMarkerTemplate for setting the initial value of the pointmarker and your style-set value.

This workaround is more complicated as it requires creating a style or template in code, or use of WPF Data-triggers.

Let me know if this helps,

Best regards,

  • You must to post comments

Hi Andrew,

The above suggestions did not work for me, the EllipsePointMarkers did not change any of their properties as function of the style.

But Yuriy suggested setting a StyleKey in my view model and on the Style in xaml and that did the trick.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.