This is a migrated thread and some comments may be shown as answers.

Needing help charting 1 series

1 Answer 27 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Keith Stephens
Top achievements
Rank 1
Keith Stephens asked on 24 Mar 2011, 03:33 PM
I am trying to generate a bar graph.
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

1 Answer, 1 is accepted

Sort by
0
Keith Stephens
Top achievements
Rank 1
answered on 24 Mar 2011, 06:30 PM
Solved.  Issue with the ajax manager.
Tags
Chart (Obsolete)
Asked by
Keith Stephens
Top achievements
Rank 1
Answers by
Keith Stephens
Top achievements
Rank 1
Share this question
or