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

Set individual series color in 3D chart

4 Answers 82 Views
Chart
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 06 Apr 2012, 09:14 PM
I have implemented the use of the 2D chart (bar, line, splinearea, splineseries) in software and have no problems setting the graphing color fill for each series in the charts data set.  I was hoping that the 3D chart used the same methodology but this does not appear to be the case.  I need to be able to set each series to a user chosen color.  It should not be this hard but I can't find any information on how to set up each series.  It appears that the chart just picks each color automatically without giving the ability to have it manually set.  Please help! 

The way that I set the color with the 2D charts is as follows:
 lineSeries.Definition.Appearance.Stroke = new SolidColorBrush(Colors.Blue);
 lineSeries.Definition.Appearance.Fill = new SolidColorBrush(Colors.Blue);

If I change the lineSeries type to Line3DSeriesDefinition then the default aqua color that comes up with the examples is used even when the color Blue is set as defined above.

Thanks for any help that can be provided!

James

4 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 06 Apr 2012, 10:30 PM
It looks like I can make this work by using the PaletteBrushes collection of the Chart control as long as I add the brush color in the same order that I add the series.  I really don't like this because the color is not directly associated with the series when this happens.  Another problem with doing it like this is the fact that anything other than a SolidColorBrush will not work.  In particular we offer the user the ability to paint the series with a LinearGradient brush and this does not work.  The end color from the LinearGradientBrush is the one that is displayed.  This moves me one step closer but still does not remedy the problem that I am trying to resolve.  If anyone can provide some direction on how to provide each series in a 3D or 2D chart with either a SolidColorBrush or LinearGradientBrush then please chime in.

Thanks for any help that you can offer.

James
0
James
Top achievements
Rank 1
answered on 11 Apr 2012, 03:05 PM
So I guess does this mean that there is no other way to provide a linear gradient brush as well as a solid brush to both 2D and 3D charts and have the linear gradient brush paint correctly?  I would really appreciate an answer from the Telerik team on this question so that I know if I can it is possible.  Please let me know as soon as possible.  The version of the WPF controls that I am using is 2010.2.10.806.

Thanks,

James
0
Accepted
Sia
Telerik team
answered on 12 Apr 2012, 09:13 AM
Hello James,

Please excuse me for the late reply.
Unfortunately you found the only possible solution for your scenario - using palette brushes (but as you found out by yourself their use in 3D has some limitations).
Another solution is shown in our "3D Bar" example in our demos, where a custom style is used but it also is not enough flexible.

Kind regards,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
James
Top achievements
Rank 1
answered on 12 Apr 2012, 02:11 PM
Sia,

Thanks for the answer.  I have seen the custom styles that you speak of but that only seems to work on a chart wide basis and not on the individual series.  Thanks again.

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