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

0 votes
233 views

There are multiple Y axes in my chart. I am displaying grid lines only for the primary axis and I would like to change its color. Please let me know how it might be possible.
I have tried style and it works for X axis (single axes) but doesn’t for Y axes (multiple)

    <Style x:Key="MajorGridLineStyle" TargetType="Line">
        <Setter Property="Stroke" Value="Red"/>
    </Style>


        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisTitle="{Binding XAxisTitle}" DrawMajorBands="False" DrawMinorGridLines="False" DrawMinorTicks="False"
                           MajorGridLineStyle="{StaticResource MajorGridLineStyle}"/>
        </s:SciChartSurface.XAxis>

I have also tried majorgridlinebrush in my viewmodel but it doesn’t work. Some default color is show for the gridlines

        YAxes.Add(new NumericAxisViewModel
        {
            DrawMajorBands = false,
            DrawMinorGridLines = false,
            DrawMinorTicks = false,
            MajorGridLinesBrush = new SolidColorBrush(Colors.Red)
        });
Showing 1 result
This template supports the sidebar's widgets. Add one or use Full Width layout.