I am trying to figure out how to wire up the json values that are being returned from an mvc submit requested by a button to the datasource of a line plot. I have verified the data is being returned as a json array of objects[] with the scema {string seriesname, double[] xvalues, double[] yvalues}. However, my call to createPlot(..) is only drawing the basic line plot WITHOUT my data. Firebug is not reporting any errors and I confirmed the "plotdata" returned in the OnSuccess(..) method contains my json data.
Maybe I'm just being stupid or showing that I am inexperienced but I am hoping someone can point me in the right direction.
Thank you!
Marcus
<script type="text/javascript">
function OnSuccess(plotdata) {
var localDataSource = new kendo.data.DataSource({
data: plotdata,
transport: {
read: {
url: ('@Url.Action("PlotData")'),
dataType: "json"
}
}
});
createPlot(localDataSource);
}
function createPlot(plotdata) {
$("#myplot").kendoChart({
theme: $(document).data("kendoSkin") || "default",
seriesDefaults: {
type: "line"
},
dataSource: plotdata,
series: [{
field: "yvalues"
}],
categoryAxis: {
field: "xvalues"
},
});
}
</script>
Maybe I'm just being stupid or showing that I am inexperienced but I am hoping someone can point me in the right direction.
Thank you!
Marcus
<script type="text/javascript">
function OnSuccess(plotdata) {
var localDataSource = new kendo.data.DataSource({
data: plotdata,
transport: {
read: {
url: ('@Url.Action("PlotData")'),
dataType: "json"
}
}
});
createPlot(localDataSource);
}
function createPlot(plotdata) {
$("#myplot").kendoChart({
theme: $(document).data("kendoSkin") || "default",
seriesDefaults: {
type: "line"
},
dataSource: plotdata,
series: [{
field: "yvalues"
}],
categoryAxis: {
field: "xvalues"
},
});
}
</script>