Commit a481707c authored by Brandon Bernal's avatar Brandon Bernal

transformForArcLabel NaN error.

Sometimes the data provided can't be used for <code>transformForArcLabel</code> (a stacked area chart where registered items came back as neither connected or disconnected. http://jsfiddle.net/U5g3h/). I find that the <code>startAngle</code> and <code>endAngle</code> values arrive as <code>NaN</code>. To fix this I am checking before assigning <code>x</code> and <code>y</code>.
parent b0b7710c
......@@ -1031,8 +1031,8 @@
var updated = updateAngle(d), c, x, y, h, ratio, translate = "";
if (updated && !hasGaugeType(c3.data.targets)) {
c = svgArc.centroid(updated);
x = c[0];
y = c[1];
x = isNaN(c[0]) ? 0 : c[0];
y = isNaN(c[1]) ? 0 : c[1];
h = Math.sqrt(x * x + y * y);
// TODO: ratio should be an option?
ratio = radius && h ? (36 / radius > 0.375 ? 1.175 - 36 / radius : 0.8) * radius / h : 0;
......
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