I am trying to generate a bar graph.
A snippet of my code is this:
I have tried 3 things one: I have a radchart on my page called
I have also tried to programmatically create the chart and add it to a placeholder.
And 3rd, I have taken the code from the Asp.net Ajax Documentation for "Creating RadChart Programmatically" without modifying anything I even used the chartSeries.AddItem(120, "Internet")
chartSeries.AddItem(140, "Retail")
chartSeries.AddItem(35, "Wholesale") lines. And nothing.
With the first way, when I have a radchart on my page, then the chart shows up but with no data it never got the series.
The other 2 ways, the chart never shows.
Thansk for any help,
KS
A snippet of my code is this:
strPending = Convert.ToDouble(dataView.Table.Rows[0]["Pending"]);
strProposed = Convert.ToDouble(dataView.Table.Rows[0]["Proposed"]);
strSold = Convert.ToDouble(dataView.Table.Rows[0]["Sold"]);
strPerformed = Convert.ToDouble(dataView.Table.Rows[0]["Performed"]);
strTotal = Convert.ToDouble(dataView.Table.Rows[0]["TotalLeads"]);
//RadChart radChart = new RadChart();
RadChartLeads.ChartTitle.TextBlock.Text = "Sales Statistics";
// Create a ChartSeries and assign its name and chart type
ChartSeries chartSeries = new ChartSeries();
chartSeries.Name = "Sales";
chartSeries.Type = ChartSeriesType.Bar;
// add new items to the series,
// passing a value and a label string
//chartSeries.AddItem(double ValueType,string label, color)
chartSeries.AddItem(strPending, "Pending");
chartSeries.AddItem(strProposed, "Proposed");
chartSeries.AddItem(strSold, "Sold");
chartSeries.AddItem(strPerformed, "Performed");
chartSeries.AddItem(strTotal, "Total Leads");
// add the series to the RadChart Series collection
RadChartLeads.Series.Add(chartSeries);
// add the RadChart to the page.
//this.Page.Controls.Add(RadChartLeads);
//RadChart radChart = new RadChart();
//radChart.ChartTitle.TextBlock.Text = "Sales Statistics";
//ChartSeries chartSeries = new ChartSeries();
//chartSeries.Name = "Sales";
//chartSeries.Type = ChartSeriesType.Bar;
//chartSeries.AddItem(strPending, "Pending");
//chartSeries.AddItem(strProposed, "Proposed");
//chartSeries.AddItem(strSold, "Sold");
//chartSeries.AddItem(strPerformed, "Performed");
//chartSeries.AddItem(strTotal, "Total Leads");
//radChart.Series.Add(chartSeries);
//this.pchChart.Controls.Add(radChart);
I have tried 3 things one: I have a radchart on my page called
RadChartLeads
and then in the codebehind I create theChartSeries
ect.. as you can see in the code above.I have also tried to programmatically create the chart and add it to a placeholder.
And 3rd, I have taken the code from the Asp.net Ajax Documentation for "Creating RadChart Programmatically" without modifying anything I even used the chartSeries.AddItem(120, "Internet")
chartSeries.AddItem(140, "Retail")
chartSeries.AddItem(35, "Wholesale") lines. And nothing.
With the first way, when I have a radchart on my page, then the chart shows up but with no data it never got the series.
The other 2 ways, the chart never shows.
Thansk for any help,
KS