Commit d3a6bc96 authored by David Schnur's avatar David Schnur

Remove unnecessary numeric value checks.

The previous processing step already guarantees that the values are
numeric.
parent 2a189b2c
...@@ -227,22 +227,11 @@ More detail and specific examples can be found in the included HTML file. ...@@ -227,22 +227,11 @@ More detail and specific examples can be found in the included HTML file.
// Calculate the total of all slices, so we can show percentages // Calculate the total of all slices, so we can show percentages
for (var i = 0; i < data.length; ++i) { for (var i = 0; i < data.length; ++i) {
var item = parseFloat(data[i].data[0][1]); total += data[i].data[0][1];
if (item) {
total += item;
}
} }
for (var i = 0; i < data.length; ++i) { for (var i = 0; i < data.length; ++i) {
// make sure its a number
data[i].data[0][1] = parseFloat(data[i].data[0][1]);
if (!data[i].data[0][1]) {
data[i].data[0][1] = 0;
}
if (data[i].data[0][1] / total <= options.series.pie.combine.threshold) { if (data[i].data[0][1] / total <= options.series.pie.combine.threshold) {
combined += data[i].data[0][1]; combined += data[i].data[0][1];
numCombined++; numCombined++;
......
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