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

0 votes
54 views

Hi,

i’d like to style my major and minor grid lines so that they are not visible over the whole width of the chart but only in the center.
I tried to asign them a LinearGradientBrush, but that did not show the Gridline at all, clipping did not change anything on the visual appearance of the Gridlines. Are these stylings not supported for grid lines?

My styling of grid lines and axes look as the following:

<Setter Property="MajorGridLineStyle">
    <Setter.Value>
        <Style TargetType="{x:Type Line}">
            <Setter Property="Stroke" Value="DarkRed" />
            <Setter Property="StrokeThickness" Value="1" />
        </Style>
    </Setter.Value>
</Setter>
<Setter Property="MinorGridLineStyle">
    <Setter.Value>
        <Style TargetType="{x:Type Line}">
            <Setter Property="Stroke" Value="Gray" />
            <Setter Property="StrokeThickness" Value="1" />
        </Style>
    </Setter.Value>
</Setter>
...
<s:SciChartSurface.XAxis>
            <s:NumericAxis VisibleRange="{Binding ScaleBarRange}"
                           FlowDirection="RightToLeft"
                           MajorDelta="5"
                           DrawMajorGridLines="True"
                           MinorDelta="1"
                           DrawMinorGridLines="True"
                           Style="{StaticResource ScaleStyle}">
            </s:NumericAxis>
        </s:SciChartSurface.XAxis>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis Visibility="Collapsed"
                           DrawMajorGridLines="False" />
        </s:SciChartSurface.YAxis>

I attached an image that shows approximately how i’d like it to be and i already have a workaround using two surfaces overlayed over each other, but that one i’d really like to get rid of.
I’d be thankful for a hint that allows me to individually crop/clip grid lines.

Thanks,
Martin

0 votes
147 views

Looking at the documentation I’ve figured out how to style the content of the tooltip. But I can’t seem to figure out how to style the container.

You can see in the attached image the automatic blue background that matches the series. I would like to style it with our own style which is the dark background and then BorderBrush that matches the series color.

<DataTemplate x:Key="DigitalToolTipTemplate" DataType="s:XySeriesInfo">
                    <Border Style="{StaticResource BorderStyle}" BorderBrush="{Binding Stroke}">
                        <TextBlock Text="{Binding SeriesName, StringFormat='{}{0}'}" />
                    </Border>
                </DataTemplate>

This seems to style only the inner contents of the tooltip but not the whole tooltip.

Also note the BorderBrush binding (not sure if this is correct to get the series color).

Update
Now using the following code (which is working) — Now the only thing I need to figure out is what to bind for the stroke to get the series color as the border stroke.

<Style x:Key="DigitalToolTipStyle" TargetType="s:TooltipControl">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="s:TooltipControl">
                                <Border Style="{StaticResource BorderStyle}" BorderBrush="{Binding Stroke}">
                                    <ContentPresenter Content="{TemplateBinding DataContext}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
0 votes
0 answers
1k views

Hi,

I like to display the SciChart in the extra content of a PropertyItem from a PropertyGrid. But the axes and line series are not visible because the styles are not loaded. This problem happens only if I display the SciChart inside a PropertyGrid and only with SciChart. All other controls can be displayed inside the PropetyGrid easy…

How to load the SciChart style?

I am using SciChart.3.5.0.7433 with .NET 4.5.1 and the PropertyGrid from Extended WPF Toolkit

Best regards
Tobias

0 votes
1k views

Hi,

I want to style the splitter between panes of the SciCharGroup, like changing its height and color.

By using snoop, I can see that the splitter actually is a Thumb control, and SciChart applies a ControlTemplate on it(maybe I’m wrong).
But I still have no idea how to style it.

I need your help.

  • Yuhang Ji asked 2 years ago
  • last active 2 years ago
0 votes
1k views

I have a YAxis(NumericAxis) that indicates price, now I want to set different color to the label text(please see the uploaded image):

I’ve seen the ILabelProvider, but it seems to set string format.
How should I do?

  • Yuhang Ji asked 2 years ago
  • last active 2 years ago
1 vote
4k views

Have a good day!
Is there any method to make ticks go inside the chart? And how can I change length of tick line?

I’ve attached an image of desired result below.
Thanks in advance

  • Egor asked 3 years ago
  • last active 3 years ago
Showing 6 results
This template supports the sidebar's widgets. Add one or use Full Width layout.