Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to generate radhtmlchart dynamicalyy and display data column chart type of population of states in different year can u guide me or snippets


[EDIT]
C#
RadHtmlChart scatterChart = new RadHtmlChart();
           scatterChart.ID = "ScatterChart";
           scatterChart.Width = Unit.Pixel(680);
              scatterChart.Height = Unit.Pixel(400);

           scatterChart.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom;

           //scatterChart.PlotArea.XAxis.TitleAppearance.Text = "Volts";
          scatterChart.PlotArea.XAxis.TitleAppearance.Text = "Name";

          SeriesItem sitem;
              ColumnSeries clm;
              CategorySeriesItem item;
              DataTable dt=GetData();
              for (int i = 0; i < dt.Rows.Count; i++)
              {
                  clm = new ColumnSeries();
                  clm.LabelsAppearance.Visible = false;
                  clm.Name = dt.Rows[i]["Name"].ToString();
                  scatterChart.PlotArea.XAxis.DataLabelsField = dt.Rows[i]["Name"].ToString();
                  clm.GroupName = dt.Rows[i]["Year"].ToString();
                  ///

                  item = new CategorySeriesItem();

                  item.Y = Convert.ToInt32(dt.Rows[i]["Price1"]);
                  //    sitem.YValue = dt.Rows[i]["Year"].ToString();
                  //   clm.DataFieldY = dt.Rows[i]["Year"].ToString();
                  clm.SeriesItems.Add(item);
                  sitem = new SeriesItem();

                  scatterChart.PlotArea.Series.Add(clm);
              }

              //for (int i = 0; i < dt.Rows.Count; i++)
              //{
              //     scatterChart.PlotArea.XAxis.DataLabelsField = dt.Rows[i]["Name"].ToString();

              // }
          //     DataSet myDS = GetData();
             scatterChart.DataSource = dt;

             scatterChart.PlotArea.XAxis.LabelsAppearance.Visible = true;
             scatterChart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "YYYY-mm";

             scatterChart.DataBind();
              Panel1.Controls.Add(scatterChart);


code snippet has been moved from comment - Maciej Los
[/EDIT]
Posted
Updated 12-May-14 5:16am
v5
Comments
ZurdoDev 12-May-14 10:38am    
Where are you stuck?
kingsa 12-May-14 10:43am    
--content has been moved to the question--
Maciej Los
ZurdoDev 12-May-14 10:44am    
I'm stuck too. Is this you're way of asking a question?
kingsa 12-May-14 10:47am    
i want to display data in column chart , as year wise of two locations <br>
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/linqdatasource/defaultcs.aspx<br>
 <br>
but dynamically using c# and radhtmlchat class
Nelek 12-May-14 11:18am    
You should use the functionality of "improve question" widget.

Such code dump is easier to read if correctly formated in the question, and... the easier is it to read, the more probably you will get help from someone.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900