Different color all the SeriesItems in RADChart

Thread is closed for posting
3 posts, 0 answers
  1. Alex
    Alex avatar
    15 posts
    Member since:
    Apr 2011

    Posted 02 Apr 2013 Link to this post

    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. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 05 Apr 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alex
    Alex avatar
    15 posts
    Member since:
    Apr 2011

    Posted 06 Apr 2013 Link to this post

    Hi Danail Vasilev ,

    That works great!
    thank you very much!

    -Alex
Back to Top