SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0
0

Applying the following style to a FastLineRenderableSeries works fine:

<Style TargetType="s:FastLineRenderableSeries">
        <Setter Property="SeriesColor" Value="LightGreen" />
        <Setter Property="PointMarkerTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <s:EllipsePointMarker Fill="LightGreen" Stroke="LightGreen" StrokeThickness="3" Width="7" Height="7"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

But the following does not work at all:

<Style TargetType="s:BaseRenderableSeries">
        <Setter Property="SeriesColor" Value="white"/>
        <Setter Property="PointMarkerTemplate">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type s:BasePointMarker}">
                    <s:EllipsePointMarker Fill="White" Stroke="White" StrokeThickness="3" Height="5" Width="5"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

a) Could this be a bug? I want this style to apply to all FastLineRenderableSeries and XyScatterRenderableSeries.
b) I noticed the style is only applied if SeriesColor and PointMarkers are not assigned at the time of RenderableSeries instantiation.

  • You must to post comments
0
0

We have this implicit style defined in our Default.xaml (which holds control templates of all SciChart parts)

<Style x:Key="DefaultRenderableSeriesStyle" TargetType="r:BaseRenderableSeries">
    <Setter Property="RolloverMarkerTemplate">
        <Setter.Value>
            <ControlTemplate>
                <r:TemplatableControl ContentTemplate="{StaticResource DefaultRolloverMarkerTemplate}" />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="LegendMarkerTemplate" Value="{StaticResource DefaultLegendMarkerTemplate}" />
</Style>

<Style BasedOn="{StaticResource DefaultRenderableSeriesStyle}" TargetType="r:BaseRenderableSeries" />

It’s true we don’t define a PointMarkerTemplate, but the style is being applied.

Is it possible your style is not being applied for some reason? Style inheritance and precedence is a tricky topic in WPF.

The other thing you could try is basing your implicit style on ours, e.g.

<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <!-- Include our Default.xaml resource dictionary -->
            <ResourceDictionary Source="pack://application:,,,/Abt.Controls.SciChart.Wpf;component/Themes/BlackSteel.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</UserControl.Resources>

<!-- Define your own implicit style and base it on our DefaultRenderableSeriesStyle -->
<Style BasedOn="{StaticResource DefaultRenderableSeriesStyle}" TargetType="r:BaseRenderableSeries">
     <!-- Your style code here -->
</Style>
  • bbmat
    I found what the issue was. If I assign pointmarkers at the time of instantiation of RenderableSeries then the style is not applied correctly. I create RenderableSeries in code behind and only if I do not define pointmarkers at time of creation of RenderableSeries does the style work.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.