Hi,
I added a pic chart to my aspx page and I bind it from codebehind using a db query.
My problem is that whenever the results count is bigger than 10, the pie renders 10 colored slices and all the rest shows as black slices in the pie.
This is my code:
protected void run_Graph() {//run graph //BIND THE DATA TO THE CHART DataSet graphDataSet = get_gDataset(Session["queryString"].ToString()); //DataSet graphDataSet = get_gDataset("select top 12 supplier_name, count(*) as no_of_orders from az group by supplier_name"); string col1 = graphDataSet.Tables[0].Columns[0].ColumnName; foreach (DataRow row in graphDataSet.Tables[0].Rows) { PieChart1.PieChartValues.Add(new AjaxControlToolkit.PieChartValue { Category = row[col1].ToString(),//row["supplier_name"].ToString(), Data = Convert.ToDecimal(row[graphDataSet.Tables[0].Columns[1].ColumnName])//Convert.ToDecimal(row["no_of_orders"]) }); } PieChart1.DataBind(); }
<asp:Panel ID="graphReport" runat="server" > <ajaxToolkit:PieChart ID="PieChart1" ChartHeight="300" ChartWidth = "450" runat="server" ></ajaxToolkit:PieChart> </asp:Panel>