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

LineSeries dotted line and Theme

1 Answer 125 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nicolas Wagener
Top achievements
Rank 1
Nicolas Wagener asked on 12 Jul 2010, 02:31 PM
Hello,
i was using this thread for my dotted lines on my RadChart :
http://www.telerik.com/community/forums/silverlight/chart/dashed-dotted-line.aspx

and it's seems that a dotted line isn't working with another theme than the default.

I wanted to use the dotted line with the Windows 7 theme but the Office_BlackTheme is the only one that works.

RadChart rc = new RadChart();
        ChartArea ca = new ChartArea();
        DataSeries ds = new DataSeries();
        DataSeries ds2 = new DataSeries();
 
        public MainPage()
        {
            InitializeComponent();
 
            Style pathStyle1 = new Style(typeof(Path));
            pathStyle1.Setters.Add(new Setter(Shape.StrokeDashArrayProperty, "1"));
            pathStyle1.Setters.Add(new Setter(Shape.StrokeProperty, new SolidColorBrush(Colors.Cyan)));
            pathStyle1.Setters.Add(new Setter(Shape.StrokeThicknessProperty, 3));
 
            Style lineStyle1 = new Style(typeof(Telerik.Windows.Controls.Charting.LineSeries));
            lineStyle1.Setters.Add(new Setter(LineSeries.BorderLineStyleProperty, pathStyle1));
 
            Style pathStyle2 = new Style(typeof(Path));
            pathStyle2.Setters.Add(new Setter(Shape.StrokeDashArrayProperty, "1"));
            pathStyle2.Setters.Add(new Setter(Shape.StrokeProperty, new SolidColorBrush(Colors.Orange)));
            pathStyle2.Setters.Add(new Setter(Shape.StrokeThicknessProperty, 3));
 
            Style lineStyle2 = new Style(typeof(Telerik.Windows.Controls.Charting.LineSeries));
            lineStyle2.Setters.Add(new Setter(LineSeries.BorderLineStyleProperty, pathStyle2));
 
            rc.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;
 
            ds.Definition = new LineSeriesDefinition() { SeriesStyle = lineStyle1, ShowItemLabels = false, ShowPointMarks = false };
            ds2.Definition = new LineSeriesDefinition() { SeriesStyle = lineStyle2, ShowItemLabels = false, ShowPointMarks = false };
 
            for (int i = 0; i < 10; i++)
            {
                ds.Add(new DataPoint() { YValue = i * i * 2, XValue = i });
                if(i==2 || i == 4 || i == 6)
                    ds2.Add(new DataPoint() { YValue = (i+100) * i * 2, XValue = i });
            }
 
            ca.DataSeries.Add(ds);
            ca.DataSeries.Add(ds2);
 
            rc.DefaultView.ChartArea = ca;
 
            LayoutRoot.Children.Add(rc);
 
            //Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.Windows7Theme());
            //Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.VistaTheme());
            //Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.SummerTheme());
            Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.Office_BlackTheme());
            //Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.Office_BlueTheme());
            //Telerik.Windows.Controls.StyleManager.SetTheme(rc, new Telerik.Windows.Controls.Office_SilverTheme());
        }

Am I wrong somewhere or is it a bug that you don't know ?

Regards,
Nicolas Wagener.

1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 14 Jul 2010, 11:21 AM
Hi Nicolas Wagener,

Unfortunately I confirm that there is a problem with the dashed style when a different theme from the default one is set. Your telerik points are updated. Thank you very much for bringing this to our attention. Our developers will investigate it in detail.

You can check the status of this issue in our Public Issues Tracking system.

All the best,
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
Nicolas Wagener
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or