radchart

Thread is closed for posting
5 posts, 1 answers
  1. Gokul
    Gokul avatar
    11 posts
    Member since:
    Apr 2013

    Posted 23 Apr 2013 Link to this post

    hello
     i want to display the bars on same chart with different color ,i tried many ways it's not working.....
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Apr 2013 Link to this post

    Hi,

    Please check the following help documentation.
    How Do I Assign Individual Colors to Bars?

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gokul
    Gokul avatar
    11 posts
    Member since:
    Apr 2013

    Posted 23 Apr 2013 Link to this post

    hi
         i get this error what should i do

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
     
      
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Apr 2013 Link to this post

    Hi Gokul,

    Unfortunately I couldn't replicate the issue. Here is my full code snippet.

    ASPX:
    <telerik:RadChart ID="RadChart1" SkinsOverrideStyles="true" runat="server">
        <PlotArea>
            <XAxis MaxValue="5" MinValue="1" Step="1">
            </XAxis>
            <YAxis MaxValue="3" Step="0.5" AxisMode="Extended">
            </YAxis>
            <YAxis2 MaxValue="5" MinValue="1" Step="1">
            </YAxis2>
        </PlotArea>
        <Series>
            <telerik:ChartSeries Name="Series 1">
                <Items>
                    <telerik:ChartSeriesItem YValue="1" Name="Item 1">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="2" Name="Item 2">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="1" Name="Item 3">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="3" Name="Item 4">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="2" Name="Item 5">
                    </telerik:ChartSeriesItem>
                </Items>
            </telerik:ChartSeries>
        </Series>
    </telerik:RadChart>

    C#:
    protected void Page_Load(object sender, EventArgs e)
        {
            RadChart1.PlotArea.XAxis.AxisLabel.Visible = false;
            Color[] barColors = new Color[5]{
            Color.Purple,
            Color.Red,
            Color.Aqua,
            Color.Yellow,
            Color.Green
        };
        if (!IsPostBack)
        {
            int i = 0;
            foreach (ChartSeriesItem item in RadChart1.Series[0].Items)
            {
                item.Appearance.FillStyle.MainColor = barColors[i++];
             
            }
        }
    }

    Thanks,
    Princy.
  6. Gokul
    Gokul avatar
    11 posts
    Member since:
    Apr 2013

    Posted 29 Apr 2013 Link to this post

    hi,
    thanks princy for ur valuble feedback,
    i have another doubt i'm using DATABIND option to fiil values in radchart using Stoterd Procedure ,here i pass a single input parameter
     and that will get six values from the Stored Procedure and that will displayed on chart and for that bars i want to change the color for each bar.....................
    thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017