Sort data on the x-axis in google graphic ruler

I am using a Google linear chart to plot data on a timeline (x-axis).

my problem is that the x axis is not sorted automatically using google graphical display.

eg. "15:45:23 678" the data point, which should be the first on the graph, is displayed at # 2. If I put this in the first place, then everything is in order. This means that the Google chart does not care about the data, and it shows how it sees it.

The problem is that my dataset is huge, and sorting it based on data on the x axis takes a lot of time. is there any flag in the line chart that could sort it in the browser?

The following are sample data:

['x', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6'],

['15:48:13 744', 0, 0, 0, 0, 0, 0], 

['15:45:23 678', 5, 17, 36, 3957, 20, 21], 

['15:48:18 749', 0, 0, 0, 0, 0, 0]
+5
source
1

DataTable:
data.sort([{column: 0}]);. 0 x.
, desc data.sort([{column: 0, desc: true}]);

getSortedRows(sortColumns).


https://developers.google.com/chart/interactive/docs/reference#DataTable_sort
https://developers.google.com/chart/interactive/docs/reference#DataTable_getSortedRows

+9

All Articles