Zooming dotted line problem

3 posts, 1 answers
  1. sunita
    sunita avatar
    9 posts
    Member since:
    Feb 2011

    Posted 25 Feb 2011 Link to this post


    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;








  2. Answer
    Sia avatar
    753 posts

    Posted 02 Mar 2011 Link to this post

    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.

    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!
  3. sunita
    sunita avatar
    9 posts
    Member since:
    Feb 2011

    Posted 07 Mar 2011 Link to this post

    hello Sia

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

    Thanks a lot

Back to Top