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

Different color all the SeriesItems in RADChart

2 Answers 160 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 02 Apr 2013, 12:48 PM
Hi Telerik,
I designed a chart (RAD Chart - HTML5)

What i want is I need to give separate color for every seriesitems
I am taking the value from DataSource.

(ex: Having 5 items in X-axis, i need each item to be in different color)

Here is the sample code,

<telerik:RadHtmlChart runat="server" Height="600px" ID="RadChart1" DataSourceID="DataSource1">
      <PlotArea>
          <Series>
               <telerik:ColumnSeries DataFieldY="Count" Name="">
               </telerik:ColumnSeries>
  </Series>
    <XAxis DataLabelsField="Status">
    <TitleAppearance Text="">
    </TitleAppearance>
    </XAxis>
    <YAxis AxisCrossingValue="0" Color="#b3b3b3" MajorTickSize="1" MajorTickType="Outside"
                       MaxValue="100" MinorTickSize="1" MinorTickType="Outside" MinValue="0" Reversed="false"
                       Step="10">
    </YAxis>
 </PlotArea>
</telerik:RadHtmlChart>


Please help me.!

Thanks in Advance
-Alex

2 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 05 Apr 2013, 06:59 AM
Hi Alex,

Since Q1 2013, the ColoField property of the Series is available not only for PieSeries but for other Series as well (e.g. ColumnSeries, BarSeries, etc). Therefore you can simply create an additional field in your datasource that contains the desired colors for the Series and reference it through the ColorField property. For example:
<telerik:RadHtmlChart runat="server" Height="600px" ID="RadChart1" DataSourceID="DataSource1">
      <PlotArea>
          <Series>
               <telerik:ColumnSeries DataFieldY="Count" ColorField="myColorField" Name="">
               </telerik:ColumnSeries>
...
</telerik:RadHtmlChart>

You can also find useful What’s new in RadHtmlChart in the Q1 2013 Release of RadControls for ASP.NET AJAX blog post as well as the road map of RadControls for Q2 2013.

Regards,
Danail Vasilev
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alex
Top achievements
Rank 1
answered on 06 Apr 2013, 01:30 PM
Hi Danail Vasilev ,

That works great!
thank you very much!

-Alex
Tags
Chart (Obsolete)
Asked by
Alex
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Alex
Top achievements
Rank 1
Share this question
or