Is there a possibility to sort chart values by multiple fields? For example, we need sorting by value but if there are same values, we want them to be sorted by name, so we can use them as:
sortField: { ['value', 'name'] }
Many thanks.
No, currently this is not possible.
Thanks for quick response.Is it going to be possible in future?
This will be included in 1.13.
Hi,
Sorting by two fields is working, thanks. However, is it possible to have it based on different alphabets?Here is the example: http://jsfiddle.net/23tmuwuo/1/
Many thanks in advance.
Currently we are using String.prototype.localeCompare with the default options to sort string values.
For your scenario I think that we would have to allow comparison delegates in the settings.
It could be enough to specify the locales argument to localeCompare - could you please check if that would work in your case? Though the problem with it is the browser support.
locales
localeCompare
In 1.14 (currently in nightly) you will be able to specify the sortField as a callback.
settings.data.sortField = function (a, b) { // handle null and undefined values as zeroes var v1 = a.value || 0; var v2 = b.value || 0; if (v1 === v2) return 0; if (v1 < v2) return 1; return -1; }
Thank you for these follow-up replies when requested features are available.Much appreciated!