Hi I am trying change to change the color of the bar chart and databinded using sql datasource. the
Here's the code behind
Page load code behind
Dim barColors As Color() = New Color(7) {Color.Purple, Color.SteelBlue, Color.Aqua, Color.Yellow, Color.Navy, Color.Green, Color.Blue, Color.Red}
GraphIncoming.ChartTitle.Text = "Number of Incoming request per Area for the Year " + dpdYearWKPerArea.SelectedValue.ToString + ""
GraphIncoming.DataBind()
Dim k As Integer = 0
GraphIncoming.PlotArea.Series(0).Name = "Value"
For Each item As ChartSeriesItem In GraphIncoming.PlotArea.Series(0).Items
item.Appearance.FillStyle.MainColor = barColors(System.Math.Max(System.Threading.Interlocked.Increment(k), k - 1))
Next
######
aspx Page
<telerik:RadHtmlChart ID="GraphIncoming" runat="server" DataSourceID="SqlDataSource2" Font-Underline="False" Skin="Office2010Blue" Width="100%">
<PlotArea>
<Series >
<telerik:ColumnSeries DataFieldY="Value" >
<Appearance FillStyle-BackgroundColor="#337ab7"></Appearance>
<TooltipsAppearance Color="White" />
</telerik:ColumnSeries>
</Series>
<XAxis DataLabelsField="Area">
<LabelsAppearance RotationAngle="45">
</LabelsAppearance>
<TitleAppearance Text="">
<TextStyle Bold="true" Color="Red" FontFamily="Verdana" FontSize="12px" Italic="true" />
</TitleAppearance>
</XAxis>
<YAxis>
<TitleAppearance Text="Number of Incoming request">
<TextStyle Bold="true" Color="Red" FontFamily="Verdana" FontSize="12px" Italic="true" />
</TitleAppearance>
</YAxis>
</PlotArea>
<Legend>
<Appearance Visible="True">
</Appearance>
</Legend>
<ChartTitle >
<Appearance Visible="True">
<TextStyle Bold="true" Color="Blue" FontFamily="Verdana" FontSize="12px" Italic="true" />
</Appearance>
</ChartTitle>
<Zoom Enabled="False"></Zoom>
</telerik:RadHtmlChart>