SplineArea color ?

3 posts, 1 answers
  1. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 14 Apr 2010 Link to this post

    Hi,

    Using the Q1 2010 version, i can't seem to set the colors and other layout settings of the spileAreaSeries.

    ineChart.DefaultSeriesDefinition.Appearance.Fill = new SolidColorBrush(Colors.LightGray);  
                LineChart.DefaultSeriesDefinition.Appearance.StrokeThickness = 4;  
                LineChart.DefaultSeriesDefinition.Appearance.Fill.Opacity = 0.5;  
    LineChart.DefaultSeriesDefinition.Appearance.PointMark.Fill = new SolidColorBrush(Colors.Transparent);  
                LineChart.DefaultSeriesDefinition.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.White);  
                LineChart.DefaultSeriesDefinition.Appearance.PointMark.StrokeThickness = 1.75;  
                LineChart.DefaultSeriesDefinition.Appearance.PointMark.Shape = MarkerShape.SquareRounded; 

    Any help ?

    Kind regards,

    Gertjan
  2. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 15 Apr 2010 Link to this post

    Hi Grtjn,

    The RadChart.DefaultSeriesDefintion property is effective only in databound scenarios:

    SplineAreaSeriesDefinition definition = new SplineAreaSeriesDefinition();
    definition.Appearance.Fill = new SolidColorBrush(Colors.LightGray);
    definition.Appearance.Fill.Opacity = 0.5;
    definition.Appearance.StrokeThickness = 4;
    definition.Appearance.PointMark.Fill = new SolidColorBrush(Colors.Transparent);
    definition.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.White);
    definition.Appearance.PointMark.StrokeThickness = 1.75;
    definition.Appearance.PointMark.Shape = MarkerShape.SquareRounded;
     
    RadChart1.DefaultSeriesDefinition = definition;
    RadChart1.ItemsSource = new int[] { 40, 30, 20, 50 };


    We suspect that you are using the control in un-bound mode -- in this case you need to set the SeriesDefinition on the DataSeries itself:

    SplineAreaSeriesDefinition definition = new SplineAreaSeriesDefinition();
    definition.Appearance.Fill = new SolidColorBrush(Colors.LightGray);
    definition.Appearance.Fill.Opacity = 0.5;
    definition.Appearance.StrokeThickness = 4;
    definition.Appearance.PointMark.Fill = new SolidColorBrush(Colors.Transparent);
    definition.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.White);
    definition.Appearance.PointMark.StrokeThickness = 1.75;
    definition.Appearance.PointMark.Shape = MarkerShape.SquareRounded;
     
    DataSeries series = new DataSeries();
    series.Definition = definition;
    series.Add(new DataPoint(40));
    series.Add(new DataPoint(30));
    series.Add(new DataPoint(20));
    series.Add(new DataPoint(50));
     
    RadChart1.DefaultView.ChartArea.DataSeries.Add(series);


    Hope this helps.


    Sincerely yours,
    Freddie
    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.
  3. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 16 Apr 2010 Link to this post

    Fredie thanks a lot for your reply.!
    The layout is now what i want it to be.

    Gertjan
Back to Top