* Get or set an accessor to order ordinal dimensions. The chart uses * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort Array.sort * to sort elements; this accessor returns the value to order on. * @example * // Default ordering
(orderFunction)
| 358 | * @returns {Function|BaseMixin} |
| 359 | */ |
| 360 | ordering (orderFunction) { |
| 361 | if (!arguments.length) { |
| 362 | return this._ordering; |
| 363 | } |
| 364 | this._ordering = orderFunction; |
| 365 | this.expireCache(); |
| 366 | return this; |
| 367 | } |
| 368 | |
| 369 | _computeOrderedGroups (data) { |
| 370 | // clone the array before sorting, otherwise Array.sort sorts in-place |
no test coverage detected