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

SplineArea color ?

2 Answers 47 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Grtjn
Top achievements
Rank 1
Grtjn asked on 14 Apr 2010, 10:54 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 15 Apr 2010, 03:36 PM
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.
0
Grtjn
Top achievements
Rank 1
answered on 16 Apr 2010, 07:38 AM
Fredie thanks a lot for your reply.!
The layout is now what i want it to be.

Gertjan
Tags
Chart
Asked by
Grtjn
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Grtjn
Top achievements
Rank 1
Share this question
or