Hello,
I have a chart filled by a JSON remote data.
Here is the result of the JSON :
[{"Id":0,"Date":"2013-03-22 11:59:25","Value":"250"},{"Id":1,"Date":"2013-03-22 11:59:27","Value":"250"},{"Id":2,"Date":"2013-03-22 11:59:29","Value":"250"},{"Id":3,"Date":"2013-03-22 11:59:31","Value":"250"},{"Id":4,"Date":"2013-03-22 11:59:33","Value":"250"},{"Id":5,"Date":"2013-03-22 11:59:35","Value":"250"},{"Id":6,"Date":"2013-03-22 11:59:37","Value":"260"},{"Id":7,"Date":"2013-03-22 11:59:39","Value":"250"},{"Id":8,"Date":"2013-03-22 11:59:41","Value":"250"},{"Id":9,"Date":"2013-03-22 11:59:43","Value":"250"}]
The problem is that I only have 1 value appearing on the graph with the time to 11:59:00
I guess it's because seconds are not taken into account, so all values are "viewed" at the same time so it's only 1 point.
Below my code for the chart :
$("#example").kendoChart({
theme: "default",
dataSource: {
transport: {
read: {
url: '@Url.Action("GetHydrogen", new { Area = "Plugins", Controller = "Temperature" })
contentType: "application/json",
dataType: "json"
}
},
sort: {
field: "Date",
dir:"asc"
}
},
title: {
text: "Hydrogen"
},
seriesDefaults: {
type: "line",
missingValues: "gap"
},
series:
[{ field: "Value", name: "Value" }],
categoryAxis: {
field: "Date",
type: "date",
labels : { step: 5, font: "8px Arial, Helvetica, sans-serif", template: "#=kendo.toString(new Date(value), 'dd/MM HH:mm:ss')#"},
maxDateGroups: 100,
baseUnit: "fit",
baseUnitStep: "auto",
majorGridLines: "none",
crosshair: {
visible: true,
tooltip: {
visible: true,
template: "|#= value #|"
}
}
},
valueAxis: {
labels: {
format: "{0}"
}
},
tooltip: {
visible: true,
template: "${category} - ${value}"
}
});
Thanks for your help
Sylvain
I have a chart filled by a JSON remote data.
Here is the result of the JSON :
[{"Id":0,"Date":"2013-03-22 11:59:25","Value":"250"},{"Id":1,"Date":"2013-03-22 11:59:27","Value":"250"},{"Id":2,"Date":"2013-03-22 11:59:29","Value":"250"},{"Id":3,"Date":"2013-03-22 11:59:31","Value":"250"},{"Id":4,"Date":"2013-03-22 11:59:33","Value":"250"},{"Id":5,"Date":"2013-03-22 11:59:35","Value":"250"},{"Id":6,"Date":"2013-03-22 11:59:37","Value":"260"},{"Id":7,"Date":"2013-03-22 11:59:39","Value":"250"},{"Id":8,"Date":"2013-03-22 11:59:41","Value":"250"},{"Id":9,"Date":"2013-03-22 11:59:43","Value":"250"}]
The problem is that I only have 1 value appearing on the graph with the time to 11:59:00
I guess it's because seconds are not taken into account, so all values are "viewed" at the same time so it's only 1 point.
Below my code for the chart :
$("#example").kendoChart({
theme: "default",
dataSource: {
transport: {
read: {
url: '@Url.Action("GetHydrogen", new { Area = "Plugins", Controller = "Temperature" })
contentType: "application/json",
dataType: "json"
}
},
sort: {
field: "Date",
dir:"asc"
}
},
title: {
text: "Hydrogen"
},
seriesDefaults: {
type: "line",
missingValues: "gap"
},
series:
[{ field: "Value", name: "Value" }],
categoryAxis: {
field: "Date",
type: "date",
labels : { step: 5, font: "8px Arial, Helvetica, sans-serif", template: "#=kendo.toString(new Date(value), 'dd/MM HH:mm:ss')#"},
maxDateGroups: 100,
baseUnit: "fit",
baseUnitStep: "auto",
majorGridLines: "none",
crosshair: {
visible: true,
tooltip: {
visible: true,
template: "|#= value #|"
}
}
},
valueAxis: {
labels: {
format: "{0}"
}
},
tooltip: {
visible: true,
template: "${category} - ${value}"
}
});
Thanks for your help
Sylvain