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

Series?

1 Answer 59 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andres
Top achievements
Rank 1
Andres asked on 18 Nov 2011, 05:23 PM
Hi, is it possible to use each value of a collection as a serie? I have several values, but I want to show them with different colors (each one as a series)

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Accepted
Hristo Germanov
Telerik team
answered on 21 Nov 2011, 05:47 PM
Hi Andres,

Thank you for contacting us.

Unfortunately you can't set different color for each value of a series. You can try this workaround:

<%= Html.Telerik().Chart()
     .Name("chart")
     .SeriesDefaults(seriesDefault => seriesDefault.Column().Stack(true))
     .Series(series =>
     {
       series.Column(new int?[] { 1, null, null }).Name("Series 1");
       series.Column(new int?[] { null, 2, null }).Name("Series 2");
       series.Column(new int?[] { null, null, 3 }).Name("Series 3");
     })
     .CategoryAxis(axis => axis
       .Categories(new string[] {"1", "2", "3"})
     )
%>

Kind regards,
Hristo Germanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Chart
Asked by
Andres
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or