DHTMLX Docs & Samples Explorer

sort (key, direction)

Required library edition: This method works with any edition of DHTMLX library

Required library file: dhtmlxchart.js

adds any user-defined handler to available events

  • key - name of property, by which chart will be sorted, or custom sorting method,
  • direction - sorting direction can take “asc” or “desc” values,
  • method - sorting method: “int”, “string”, “string_strict” or custom
	chart.sort("Year","asc","int");
	chart.sort(function(a,b){
		return a.Version > b.Version ? 1 : -1;
	},"asc");