Commit bc707fea authored by Phil Tsarik's avatar Phil Tsarik

Pie: Fix combined data to keep all other original values.

But not only data, color, label, angle, percent as was before.
Allows to store own values in series and use them e.g. in labelFormatter.
parent e2147c07
...@@ -224,13 +224,15 @@ More detail and specific examples can be found in the included HTML file. ...@@ -224,13 +224,15 @@ More detail and specific examples can be found in the included HTML file.
for (var i = 0; i < data.length; ++i) { for (var i = 0; i < data.length; ++i) {
var value = data[i].data[0][1]; var value = data[i].data[0][1];
if (numCombined < 2 || value / total > options.series.pie.combine.threshold) { if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
newdata.push({ newdata.push(
data: [[1, value]], $.extend(data[i], {
color: data[i].color, data: [[1, value]],
label: data[i].label, color: data[i].color,
angle: value * Math.PI * 2 / total, label: data[i].label,
percent: value / (total / 100) angle: value * Math.PI * 2 / total,
}); percent: value / (total / 100)
})
);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment