Charts in asp.net
Please tell me can I make charts and graphs using values in database and how can I do the same?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Wim SturkenboomRank #2,527 · 554 reputationPosted Sep 28, 2014, 7:55 AM EDT
Drag a chart control into your form.
In code behind, bind it using something like below
ChartBW.Series.Add("test");
ChartBW.Series["test"].XValueMember = "Timestamp";
ChartBW.Series["test"].YValueMembers = "Bandwidth_kbps";
ChartBW.Series["test"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Line;
ChartBW.Series["test"].Color = System.Drawing.Color.Blue;
ChartBW.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
ChartBW.ChartAreas["ChartArea1"].AxisX.LabelStyle.Format = "yyyyMMdd\nHHmm";
ChartBW.ChartAreas["ChartArea1"].AxisX.Title = "Timestamp";
ChartBW.ChartAreas["ChartArea1"].AxisY.Title = "BandWidth (kbps)";
ChartBW.Titles.Add(ddlDecoders.SelectedItem.ToString());
ChartBW.DataSource = tbl;
ChartBW.DataBind();