DHTMLX Docs & Samples Explorer

Index
dhtmlxchart
API Methods

## sort (key, direction)

Required library edition:

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");