This is a migrated thread and some comments may be shown as answers.

Default visual style on LineSeries does not work

1 Answer 259 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 25 Feb 2019, 06:22 PM

I am trying to set the default visual style of my line series. (Using Telerik UI for WPF 2015)

Based on the page, the default visual style of the dot & line styling can be set at the default visualstyle properties:

https://docs.telerik.com/devtools/wpf/controls/radchartview/styles-and-templates/customizing-cartesianchart-series

 

This configuration does not seems to work on Telerik UI for WPF 2015, how do I set the dot size & coloring on line series ? 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 28 Feb 2019, 12:19 PM
Hi Christopher,

Thank you for your interest in our RadChartView UI for WPF.

Since R1 2016 the chart's line series have default visual elements for their data points. This means that you can use the DefaultVisualStyle property to customize the data points visuals. Before this version, you can set a custom style to the StrokeShapeStyle property of the LineSeries to change the Stroke or StrokeDashArray property. Please, refer to the following code snippet.
<telerik:RadCartesianChart >
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis />
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:LineSeries >
            <telerik:LineSeries.StrokeShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Stroke" Value="Red"/>
                    <Setter Property="StrokeDashArray" Value="10 5"/>
                    <Setter Property="StrokeThickness" Value="3"/>
                </Style>
            </telerik:LineSeries.StrokeShapeStyle>
            <telerik:LineSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="January" Value="2" />
                <telerik:CategoricalDataPoint Category="February" Value="5" />
                <telerik:CategoricalDataPoint Category="March" Value="3" />
                <telerik:CategoricalDataPoint Category="April" Value="10" />
                <telerik:CategoricalDataPoint Category="May" Value="9" />
                <telerik:CategoricalDataPoint Category="June" Value="7" />
                <telerik:CategoricalDataPoint Category="July" Value="1" />
            </telerik:LineSeries.DataPoints>
        </telerik:LineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

As a side note, I would highly recommend you to use the latest version of our controls so you can take advantage of the newest improvements, bug fixes, and new controls.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Christopher
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or