Hi,
Im using radhmtl chart and binding the data using Dataset, I want to show the column series on different colors based on data, Can you please help how to add different colors for columnseries based on the condition I have, following is the code
<telerik:RadHtmlChart runat="server" ID="RadHtmlChart5" Width="600px" Height="400px" Visible="false" OnDataBound="RadHtmlChart5_DataBound">
<PlotArea>
<Series>
<telerik:ColumnSeries Name="Hours" DataFieldY="TotalHours">
<TooltipsAppearance Color="White"></TooltipsAppearance>
</telerik:ColumnSeries>
</Series>
<XAxis DataLabelsField="Service"></XAxis>
<YAxis><MinorGridLines Visible="false"></MinorGridLines></YAxis>
</PlotArea>
<Legend><Appearance Visible="false"></Appearance></Legend>
<ChartTitle Text="Total Hours Per Service"></ChartTitle>
</telerik:RadHtmlChart>
DataTable dt = new DataTable();
dt=Cls.GetAllData(id);
RadHtmlChart5.Visible = true;
for(int i=0; i<dt.Rows.Count; i++)
{
if (dt.Rows[0]["Service"].ToString() == "Employee")
{
//I want to show columnserries color as red
}
if (dt.Rows[0]["Service"].ToString() == "Vendor")
{
//I want to show columnserries color as blue
}
if (dt.Rows[0]["Service"].ToString() == "Contractor")
{
//I want to show columnserries color as green}
}
RadHtmlChart5.DataSource = dt;
RadHtmlChart5.DataBind();
Im using radhmtl chart and binding the data using Dataset, I want to show the column series on different colors based on data, Can you please help how to add different colors for columnseries based on the condition I have, following is the code
<telerik:RadHtmlChart runat="server" ID="RadHtmlChart5" Width="600px" Height="400px" Visible="false" OnDataBound="RadHtmlChart5_DataBound">
<PlotArea>
<Series>
<telerik:ColumnSeries Name="Hours" DataFieldY="TotalHours">
<TooltipsAppearance Color="White"></TooltipsAppearance>
</telerik:ColumnSeries>
</Series>
<XAxis DataLabelsField="Service"></XAxis>
<YAxis><MinorGridLines Visible="false"></MinorGridLines></YAxis>
</PlotArea>
<Legend><Appearance Visible="false"></Appearance></Legend>
<ChartTitle Text="Total Hours Per Service"></ChartTitle>
</telerik:RadHtmlChart>
DataTable dt = new DataTable();
dt=Cls.GetAllData(id);
RadHtmlChart5.Visible = true;
for(int i=0; i<dt.Rows.Count; i++)
{
if (dt.Rows[0]["Service"].ToString() == "Employee")
{
//I want to show columnserries color as red
}
if (dt.Rows[0]["Service"].ToString() == "Vendor")
{
//I want to show columnserries color as blue
}
if (dt.Rows[0]["Service"].ToString() == "Contractor")
{
//I want to show columnserries color as green}
}
RadHtmlChart5.DataSource = dt;
RadHtmlChart5.DataBind();