I use Kendo UI chart in scatter line mode to display data that was received from a sensor over time. I get the data from my server in JSON.
Sometimes I don't want the chart to display all the data that was received from the server,
and sometimes I want to display a specific range of time (which the user had selected) even if there is no data at this time.
in order to accomplish this i figured i need to set up the graph's xAxis option like this:
xAxis: {
min : fromSelectedTime,
max : toSelectedTime,
type: "date",
}
but when I add this option to the graph it stops displaying the graph correctly:
1) it only displays the min and max scales on the x axis and nothing in between.
2) more important: the values are not aligned correctly respectively to the x axis
(an item with the time of 1 pm on the 2nd of Oct for example is display before the 10/2 scale instead of after or not at all)
I've created a JSFiddle that shows the problem:
http://jsfiddle.net/ZZZF7/2/
It shows wrong display of the graph.
jsonData simulates the data that I receive from the server. please not that in this case (but not always):
the first item is later than the min time (data.From = Tue, 01 Oct 2013 12:35:00 GMT)
and the last item is later than the max time (data.To = Wed, 02 Oct 2013 12:35:00 GMT).
if you would remove lines 41-45 the graph is displayed as expected.
Sometimes I don't want the chart to display all the data that was received from the server,
and sometimes I want to display a specific range of time (which the user had selected) even if there is no data at this time.
in order to accomplish this i figured i need to set up the graph's xAxis option like this:
xAxis: {
min : fromSelectedTime,
max : toSelectedTime,
type: "date",
}
but when I add this option to the graph it stops displaying the graph correctly:
1) it only displays the min and max scales on the x axis and nothing in between.
2) more important: the values are not aligned correctly respectively to the x axis
(an item with the time of 1 pm on the 2nd of Oct for example is display before the 10/2 scale instead of after or not at all)
I've created a JSFiddle that shows the problem:
http://jsfiddle.net/ZZZF7/2/
It shows wrong display of the graph.
jsonData simulates the data that I receive from the server. please not that in this case (but not always):
the first item is later than the min time (data.From = Tue, 01 Oct 2013 12:35:00 GMT)
and the last item is later than the max time (data.To = Wed, 02 Oct 2013 12:35:00 GMT).
if you would remove lines 41-45 the graph is displayed as expected.