Is there any examples on how to send (data and labels) from server side to a javascript function to create a chartJs dynamically?
I tried via htmlpanel to create a chart but could not be able to send coorectly the parameters.
Thanks.
I would not recommend using htmlpanel. Instead, use the chartJS extension. It is a nuget package. In Solution Explorer, right-click, choose “Manage Nuget Packages”, and search for “Wisej ChartJS”.
The code to add data and labels to a chartJS chart looks like this:
object[] array1 = new object[] { 1, 3, 5, 7, 9 };
chartJS1.DataSets.Add("Data Set").Data = array1;
chartJS1.Labels = new string[] {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"};
See attached sample project.
Hope this helps!
-Julie
Please login first to submit.