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

radchart

4 Answers 70 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Gokul
Top achievements
Rank 1
Gokul asked on 23 Apr 2013, 06:38 AM
hello
 i want to display the bars on same chart with different color ,i tried many ways it's not working.....

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Apr 2013, 08:25 AM
Hi,

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

Thanks,
Princy.
0
Gokul
Top achievements
Rank 1
answered on 23 Apr 2013, 08:40 AM
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
 
  
0
Accepted
Princy
Top achievements
Rank 2
answered on 29 Apr 2013, 05:25 AM
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.
0
Gokul
Top achievements
Rank 1
answered on 29 Apr 2013, 09:23 AM
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
Tags
Chart (Obsolete)
Asked by
Gokul
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Gokul
Top achievements
Rank 1
Share this question
or