Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

How to add point on each chart data point

$
0
0
Hello Berry,

You can use the PointTemplate property of the series to define its visual element. For example:
<telerik:LineSeries.PointTemplate>
    <DataTemplate>
        <Ellipse Fill="Red" Width="10" Height="10" />
    </DataTemplate>
</telerik:LineSeries.PointTemplate>
To add this in code you can define the template in XAML and get it through the Resources' dictionary of the view:
<Window.Resources>
    <DataTemplate x:Key="pointTemplate">
        <Ellipse Fill="Red" Width="10" Height="10" />
    </DataTemplate>
</Window.Resources>

series.PointTemplate = (DataTemplate)this.Resources["pointTemplate"];

Or you can define the template as string and use the XamlReader.Parse() method.
string pointTemplateString = @"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">"+
                      @"<Ellipse Fill=""Red"" Width=""10"" Height=""10"" /></DateTemplate>";

series.PointTemplate = (DataTemplate)XamlReader.Parse(pointTemplateString);

I hope this is useful.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>