Strange diagonal line in Google Visualization API -
sometimes strange diagonal line in google line chart. please see below blue volume chart.
it has "closing" line first last value.
any idea how comes?
data = new google.visualization.datatable() data.addcolumn('datetime', 'date') data.addcolumn('number', 'volume') data.addcolumn('number', 'connected') tracking in trackings if(tracking.createdat instanceof date && tracking.volume? && typeof tracking.volume "number") connected = if(tracking.connected? && tracking.connected) 10000 else -10000 data.addrow([tracking.createdat, tracking.volume, connected]) options = { title: 'sensor values' legend: position: 'bottom' haxis: minvalue: maxvalue: curvetype: 'function' } chart = new google.visualization.linechart(document.getelementbyid('volumechart')) chart.draw(data, options)
the issue disappears when sort data date.
it appeared when had ca. more 200 unsorted data points on graph.
in meteor / mongodb worked me:
data = sensortracking.find({}, {sort: {createdat: 1}}).fetch()
Comments
Post a Comment