Set individual series color in 3D chart

5 posts, 1 answers
  1. James
    James avatar
    44 posts
    Member since:
    Jan 2012

    Posted 06 Apr 2012 Link to this post

    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

  2. James
    James avatar
    44 posts
    Member since:
    Jan 2012

    Posted 06 Apr 2012 Link to this post

    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

  3. James
    James avatar
    44 posts
    Member since:
    Jan 2012

    Posted 11 Apr 2012 Link to this post

    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

  4. Answer
    Sia
    Admin
    Sia avatar
    599 posts
    Member since:
    Sep 2012

    Posted 12 Apr 2012 Link to this post

    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 >>

  5. James
    James avatar
    44 posts
    Member since:
    Jan 2012

    Posted 12 Apr 2012 Link to this post

    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

Back to Top