I am using JSON to get chart data from MVC Controller to the charts View page. All is working fantastic.
I decided to use the chart JSON thread to send some additional data to be used by the View page.
I am unsure how to pickup this additional data once its in the View.
Here is the first part of my code;
function addData(data) {
for (var i = 0; i < data.length; i++) {
dataPoints.push({
label: data[i].label,
x: data[i].x,
y: data[i].y,
indexLabel: data[i].preLabel,
color: data[i].color,
periodName: data[i].periodName,
jobName: data[i].jobName,
z: data[i].z,
sortDate: data[i].sortDate,
extraData : data[i].extraData,
});
}
chart.render();
}
I have tried the following in Javascript to pick up the extraData. This is obviously not correct. Can someone show me the correct syntax here?
var pageName == extraData[0].value
var alertMessage == extraData[1].value