I need to sort the data of series from largest to smallest for every series.
series: [{
name: 'John',
data: [{
y: 1}, {y: 2}, {y: 3}, {y: 4}, {y: 5
}]
}, {
name: 'Jane',
data: [{
y: 5}, {y: 4}, {y: 3}, {y: 2}, {y: 1
}]
}, {
name: 'Joe',
data: [{
y: 5}, {y: 2}, {y: 3}, {y: 4}, {y: 1
}]
}]
You can use the sort function. It can be applied like that:
To make the code more understandable you can create a
series
variable and then sort it before calling thehighcharts
function. This is demonstrated here.