Home › forums › Using CanvasJS › ASP.Net Web Forms and CanvasJS
Tagged: asp.net, C#, Web Forms
This topic contains 0 replies, has 1 voice, and was last updated by JMcCarthy 3 years, 10 months ago.
My university is looking for a web charting tool that allows the university to “stand out” on charts/graphs. In the past, we’ve manually customized Excel charts to highlight USF and presented the data in a printed book (see examples below). We are building a website take the place of the book. The ASP.Net Web Form website pulls from a Microsoft SQL Server database. The charts are in a .aspx file with the code file in the aspx.cs file, which is written in C#.
Bar chart example from Excel:
Line chart example from Excel:
I’ve tried looking up the following in the forums but can’t find anything relevant to ASP.Net Web Forms.
The C# code in the aspx.cs file:
public void BuildDataTable()
string panda_db = ConfigurationManager.ConnectionStrings["panda_db"].ConnectionString; // stored in web.config file
SqlConnection conn = new SqlConnection(panda_db);
string query = "SELECT InstitutionName, DataValue FROM dbo.EXT_DataValues where SourceVariableName = 'Total Student Headcount' and StandardYear = '2013' order by InstitutionName";
SqlCommand cmd = new SqlCommand(query, conn);
dtHeadCount = new DataTable();
using (SqlDataAdapter a = new SqlDataAdapter(cmd))
catch (Exception ex)
lblStatus.Text = ex.ToString();
2) Will CanvasJS allow me to change the color and other attributes of a specific bar or line in a chart, see URL above for examples? If so, how? How do I cycle through the data to find “USF” and change only its bar or line attributes?
Any help would be appreciated!
You must be logged in to reply to this topic.