Good evening,
I am having some basic issue with connecting a dataview to a chart and getting the piechart to show.
Heres My results:
the first chart is set up as follows:
this.radChartView1.AreaType = ChartAreaType.Pie;
PieSeries series = new PieSeries();
series.DataPoints.Add(new PieDataPoint(50, "Germany"));
series.DataPoints.Add(new PieDataPoint(70, "United States"));
series.DataPoints.Add(new PieDataPoint(40, "France"));
series.DataPoints.Add(new PieDataPoint(25, "United Kingdom") { Label = "My Label" });
series.ShowLabels = true;
series.DrawLinesToLabels = true;
series.SyncLinesToLabelsColor = true;
this.radChartView1.ShowSmartLabels = true;
this.radChartView1.Series.Add(series);
Hardcoded.
the next one is my dataview;
DataSet dsAnswer = new DataSet();
DataView dvResult = new DataView();
var db = Spectrotel.Library.DatabaseUtilities.DatabaseHelper.GetDB("RevIO");
var cmd = db.GetStoredProcCommand("getme");
string strSQLCMD = "";
strSQLCMD = "[spectrotel].[sp_Rpt_Progress_getTodaysUsers]";
cmd = db.GetStoredProcCommand(strSQLCMD);
cmd.CommandTimeout = 10800;
dsAnswer = db.ExecuteDataSet(cmd);
dvResult = dsAnswer.Tables[0].AsDataView();
radChartView2.AreaType = ChartAreaType.Pie;
PieSeries series2 = new PieSeries();
series2.DataSource = dvResult;
series2.DisplayMember = "Bucket";
//series.DataMember = "Cnts"; // it dont like this at all!
series2.ShowLabels = true;
series2.DrawLinesToLabels = true;
series2.SyncLinesToLabelsColor = true;
radChartView2.ShowSmartLabels = true;
radChartView2.Series.Add(series2);
The data coming back from SQL is:
What am I doing wrong here?
Just want the basic C# code to get a piechart to appear like the first with my data.
Thanks.
Deasun.