I am doing coding of ASP.NET chart control and chart code is as per below
<asp:Chart ID="Chart1" runat="server" Width="450px" Height="200px" BackColor="211, 223, 240"
Palette="None" BorderLineStyle="Solid" BackGradientEndColor="White" BackGradientType="TopBottom"
BorderlineWidth="2" BorderlineColor="26, 59, 105" EnableViewState="True">
<Series>
<asp:Series Name="Series1" BorderColor="180, 26, 59, 105" Color="Blue" BorderWidth="2"
ShadowColor="254, 0, 0, 0" ChartType="Column" ShadowOffset="1" MarkerSize="8" MarkerStyle="Diamond">
<EmptyPointStyle BackGradientStyle="Center" />
</asp:Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid"
BackSecondaryColor="White" BackColor="64, 165, 191, 228" ShadowColor="Transparent"
BackGradientStyle="TopBottom">
<AxisY LineColor="#eb9c28">
<MajorGrid LineColor="64, 64, 64, 64"></MajorGrid>
</AxisY>
<AxisX LineColor="64, 64, 64, 64" TextOrientation="Horizontal" IsStartedFromZero="true">
<LabelStyle Format="dd/MM/yyyy" IntervalType="Days" Interval="1"></LabelStyle>
<MajorGrid LineColor="64, 64, 64, 64"></MajorGrid>
</AxisX>
</asp:ChartArea>
</ChartAreas>
<BorderSkin SkinStyle="Emboss" />
</asp:Chart>
and i have bind this chart control from code behind as per below
Chart1.DataSource = dt;
Chart1.Series["Series1"].XValueMember = "UTC";
Chart1.Series["Series1"].YValueMembers = "Value";
Chart1.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Minutes;
Chart1.ChartAreas[0].AxisX.Interval = 5;
Chart1.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss";
Now in dt (datasource) there is also 3rd column named as Severity and values will be “a”, “b”,”c” …
Now i would like to customize column color as per this value, means
if a -> Red
b -> Blue
c -> green like that
Please help me if any one has done this type of logic.
Thanks in advance.
You can set multiple values for the Y member by setting value for
Now for Column it would be using only one value but in the other column you could bind a value corresponding to a,b,c as say 1,2,3 and now bind this to the series.
To apply the colors you will have to loop through the points in the series like