How to change RadCartesianChart/Line Series as dashed line ?

5 posts, 0 answers
  1. irem
    irem avatar
    4 posts
    Member since:
    Oct 2016

    Posted 27 Oct Link to this post

    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,

  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 01 Nov Link to this post

    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
  3. DevCraft banner
  4. David
    David avatar
    2 posts
    Member since:
    Aug 2014

    Posted 04 Nov in reply to Pavel R. Pavlov Link to this post

    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

     

  5. David
    David avatar
    2 posts
    Member since:
    Aug 2014

    Posted 04 Nov in reply to Pavel R. Pavlov Link to this post

    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;
    }

  6. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 09 Nov Link to this post

    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
Back to Top
DevCraft banner