I have the following code -
C#
string data = string.Format("[{0}]", string.Join(",", listOfInts));
string script = string.Format("chart('{0}','{1}','{2}','{3}','{4}','{5}','{6}');",
startYear, startMonth, startDay, startHour, startMinute, chartTitle, data);
ScriptManager.RegisterStartupScript(this, GetType(), "chart", script, true);
Javascript
series: [{
type: 'area',
name: 'Count:',
pointInterval: 3600 * 1000,
pointStart: Date.UTC(startYear, startMonth, startDay, startHour, startMinute),
data: intsAsJSArray
}]
Where inrtAsJSArray
= "[1,2,3,4,5,6,7]"
.
This breaks the graphing function and I have realised that it is due to data
being in the wrong format.
However if I hard code the data
section like -
series: [{
type: 'area',
name: 'Count:',
pointInterval: 3600 * 1000,
pointStart: Date.UTC(startYear, startMonth, startDay, startHour, startMinute),
data: [1,2,3,4,5,6,7]
}]
This works, how can I reconfigure intASJarray
to be accepted into the series?