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

Zooming dotted line problem

2 Answers 71 Views
Chart
This is a migrated thread and some comments may be shown as answers.
sunita
Top achievements
Rank 1
sunita asked on 25 Feb 2011, 11:04 AM
Hello

I am using telerik chart which has dotted style to one of the line and rest has solid(default) this works fine when it loads.
but when i scroll dotted style get overwrite with solid. please help me in this. i am using following code snippet for styling to dotted line.

                                           Style pathStyle1 = new Style(typeof(System.Windows.Shapes.Path));
                                pathStyle1.Setters.Add(new Setter(System.Windows.Shapes.Shape.StrokeDashArrayProperty, "2"));
                                pathStyle1.Setters.Add(new Setter(System.Windows.Shapes.Shape.StrokeProperty, new SolidColorBrush(Colors.Cyan)));
                                pathStyle1.Setters.Add(new Setter(System.Windows.Shapes.Shape.StrokeThicknessProperty, 6));
  
                                Style lineStyle1 = new Style(typeof(Telerik.Windows.Controls.Charting.SelfDrawingSeries));
                                lineStyle1.Setters.Add(new Setter(SelfDrawingSeries.BorderLineStyleProperty, pathStyle1));
                                strColor = "#FFD29988";
                                lineDefinition.Appearance.Stroke = (Brush)ConvertColor(strColor);
                                lineDefinition.Appearance.PointMark.Stroke = (Brush)ConvertColor(strColor);
                                lineDefinition.SeriesStyle = lineStyle1;

 

 

 


Thanks
Sunita

 

 

 


2 Answers, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 02 Mar 2011, 05:00 PM
Hello sunita,

it seems that the reported issue is not related to the RadChart control but is a problem within the Silverlight framework itself. Please try the following:
  • First create Line shape, set its Line.Style property to a style instance for dashed line, then add the Line to a Canvas -- the line is correctly displayed as dashed (and the applied style becomes sealed as it was applied to FrameworkElement).
  • Now, clear the Canvas.Children, and create new Line shape but apply the same style instance that was created in Step1 (the style that is now sealed); when you add it to the Canvas you will notice that this time the line is not dashed (we believe the framework does not handle properly the StrokeDashArray value once the style becomes sealed).

The described scenario is actually what happens behind the scenes when you use the zoom/scroll feature of RadChart and that is why it behaves in the same erroneous way. Unfortunately we cannot commit a timeframe for the resolution of this issue as it is a general Silverlight problem and not RadChart one.

We have attached a sample application that demonstrates the discussed general problem as well as the proposed workaround for RadChart.

Greetings,
Sia
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
sunita
Top achievements
Rank 1
answered on 07 Mar 2011, 02:30 PM
hello Sia

Thanks for the post and example i have integrated events in my code and it works.

Thanks a lot

Sunita
Tags
Chart
Asked by
sunita
Top achievements
Rank 1
Answers by
Sia
Telerik team
sunita
Top achievements
Rank 1
Share this question
or