Dashed Line Styling with DefaultSeriesDefinition

2 posts, 1 answers
  1. Sean
    Sean avatar
    2 posts
    Member since:
    Jun 2010

    Posted 20 Jul 2010 Link to this post


    I was following this thread (http://www.telerik.com/community/forums/silverlight/chart/dashed-dotted-line.aspx) on creating dashed/dotted lines for Series in the code-behind. I was able to successfully do this by creating a separate style for each SeriesMapping.SeriesDefinition. However, if I try to do this to only the DefaultSeriesDefinition, the dotted lines do not show up correctly. The series are all colored the same and have the correct thickness, but only the first series is dashed.

    Example code:
    Style tempStyle = new Style(typeof(SelfDrawingSeries));
    Style borderLineStyle = new Style(typeof(Path));
    borderLineStyle.Setters.Add(new Setter(Shape.StrokeDashArrayProperty, "1"));
    borderLineStyle.Setters.Add(new Setter(Shape.StrokeThicknessProperty, 2));
    borderLineStyle.Setters.Add(new Setter(Shape.StrokeProperty, new SolidColorBrush(Colors.Cyan)));
    tempStyle.Setters.Add(new Setter(SelfDrawingSeries.BorderLineStyleProperty, borderLineStyle));
    radChart1.DefaultSeriesDefinition.SeriesStyle = tempStyle;

    Is there any way to do this using the DefaultSeriesDefinition? Also, why are the color and thickness applied properly to all series, but not the StrokeDashArray?


  2. Answer
    Sia avatar
    755 posts

    Posted 23 Jul 2010 Link to this post

    Hello Sean,

    Unfortunately at the moment you need to define different style per line series in order to achieve the dash and line effect. Our developers will review this and will introduce improvements in one of our future releases.

    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top