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

How to change RadCartesianChart/Line Series as dashed line ?

4 Answers 207 Views
Chart
This is a migrated thread and some comments may be shown as answers.
irem
Top achievements
Rank 1
irem asked on 27 Oct 2016, 09:01 PM

Hi, I am working on Telerik charts.

I need a dash line on the chart grid like as Line Annotation http://docs.telerik.com/devtools/xamarin/controls/chart/chart-annotations#cartesiangridlineannotation .

But the line annotation involves whole axis line instead of limited part. So I guess, I can use line series. But I could not find a way to update line series to display it as a dashed line. (I have attached sample drawing of dashed line that I need.)
Can you help me regarding this problem? 

Thanks,

4 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 01 Nov 2016, 07:55 AM
Hi irem,

You have found the supported annotations in our documentation. Unfortunately, at the moment of writing these are all the lines that are supported. The functionality to draw a custom annotation is still under development and currently your scenario cannot be achieved. Also, we cannot give any estimation on when the custom annotation will be included in our code.

Regards,
Pavel R. Pavlov
Telerik by Progress
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
0
David
Top achievements
Rank 1
answered on 04 Nov 2016, 03:49 PM

Hi Pavel,

I have urgent question. Our application Silverlight RadCartesianChart line chart need to be dashed line. I found web site to say using "LineSeries.StrokeDashArray property". Our chart is code dynamic generated not "<telerik:RadCartesianChart..." predefine in "xaml" file. Could you provide code sample? For example "catSeries = new LineSeries(); Then code to mait dashed line....". Something like "((LineSeries)catSeries).StrokeShapeStyle = ...". I can't find any code sample on the web.

Thanks,

David Z

 

0
David
Top achievements
Rank 1
answered on 04 Nov 2016, 04:01 PM

I found one sample on the web but it is old chart:

This property is not available now: LineSeries.BorderLineStyleProperty. What should be the new code for "RadCartesianChart"?

Thanks.

private static Style CreateCustomLineStyle()
{
    Style customLineStyle = new Style(typeof(LineSeries));
    Style borderLineStyle = new Style(typeof(Shape));
    borderLineStyle.Setters.Add(new Setter(Shape.StrokeDashArrayProperty, "5,10"));
    borderLineStyle.Setters.Add(new Setter(Shape.StrokeThicknessProperty, 5));
    borderLineStyle.Setters.Add(new Setter(Shape.StrokeProperty,
        new SolidColorBrush(Colors.Red)));
    customLineStyle.Setters.Add(new Setter(LineSeries.BorderLineStyleProperty,
        borderLineStyle));
    return customLineStyle;
}

0
Pavel R. Pavlov
Telerik team
answered on 09 Nov 2016, 07:50 AM
David,

This is the UI for Xamarin division. Since your question regards the Silverlight chart it is best to ask this question in our Silverlight forum.

Regards,
Pavel R. Pavlov
Telerik by Progress
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
Tags
Chart
Asked by
irem
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
David
Top achievements
Rank 1
Share this question
or