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

Dashed Line Styling with DefaultSeriesDefinition

1 Answer 58 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 20 Jul 2010, 08:47 PM
Hello,

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?

Thanks,

Sean

1 Answer, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 23 Jul 2010, 12:44 PM
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.

Regards,
Sia
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
Tags
Chart
Asked by
Sean
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or