sortValues(axisName: String, type: String, tuple: Array, measure: MeasureIdentifierObject)
[starting from version: 1.4]
Sorts a specific row or column in the compact form, the classic (tabular) form, and the chart view.
Use the setFlatSort method for sorting in the flat form.
| Parameter/Type | Description |
|---|---|
| axisName String | Specifies which axis should be sorted: rows ("rows") or columns ("columns"). |
| type String | Specifies the sort order of a row or a column. Possible values: "asc", "desc", and "unsorted". |
| tuple String[] | Members' unique names that identify a row or a column. |
| measure MeasureIdentifierObject | Specifies which measure from the slice should be sorted. |
1) Sorting a specific column in ascending order:
pivot.sortValues(
"columns",
"asc",
["category.[bikes]", "color.[red]"],
{"uniqueName": "Price"}
);
Check out on JSFiddle.
2) Remove sorting of a specific column:
pivot.sortValues(
"columns",
"unsorted",
["category.[bikes]", "color.[red]"],
{"uniqueName": "Price"}
);
See the full code on JSFiddle.