Hi everyone
I have a HTMLChart that gets populated via the database, based on a drop down.
It works fine, it populates and sets the pie chart, but the legend doesn't update. For example, if the first selection has 2 values, I get two legends, but when I then I get a selection with 4 values, it stays 2 values in the legend? Also, I have set the DataFormatString, but it stays with 4 decimals for the yValue?
Any ideas?
Thank you
[EDIT] It was due to 0 Values coming through from the DB, you couldn't see it on the chart, but it created a legend. Sorted it out now.
I have a HTMLChart that gets populated via the database, based on a drop down.
It works fine, it populates and sets the pie chart, but the legend doesn't update. For example, if the first selection has 2 values, I get two legends, but when I then I get a selection with 4 values, it stays 2 values in the legend? Also, I have set the DataFormatString, but it stays with 4 decimals for the yValue?
<telerik:RadHtmlChart ID="uxPieChart" runat="server"> <PlotArea> <Series> <telerik:PieSeries StartAngle="90"> <LabelsAppearance Position="Circle" DataFormatString="{0:C}" /> <TooltipsAppearance DataFormatString="{0:C}" /> </telerik:PieSeries> </Series> </PlotArea> <ChartTitle Text=""/></telerik:RadHtmlChart>uxPieChart.PlotArea.Series.Clear(); int fundID = int.Parse(uxFundList.SelectedValue);DataTable dt = Fund.BudgetBreakDown(fundID);PieSeries pieSeries = new PieSeries();SeriesItem item;foreach (DataRow budgetRow in dt.Rows){ item = new SeriesItem(); item.YValue = Decimal.Parse(budgetRow["Amount"].ToString()); item.Name = budgetRow["Header"].ToString(); pieSeries.Items.Add(item);}uxPieChart.PlotArea.Series.Add(pieSeries);Thank you
[EDIT] It was due to 0 Values coming through from the DB, you couldn't see it on the chart, but it created a legend. Sorted it out now.