Commit 89049f47 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix event rect width when no data

parent 27254eaa
......@@ -549,9 +549,13 @@
}
function getEventRectWidth() {
var target = getMaxDataCountTarget(c3.data.targets),
firstData = target.values[0], lastData = target.values[target.values.length - 1],
base = x(lastData.x) - x(firstData.x),
maxDataCount = getMaxDataCount(),
firstData, lastData, base, maxDataCount, ratio;
if (!target) {
return 0;
}
firstData = target.values[0], lastData = target.values[target.values.length - 1];
base = x(lastData.x) - x(firstData.x);
maxDataCount = getMaxDataCount();
ratio = (hasBarType(c3.data.targets) ? (maxDataCount - (isCategorized ? 0.25 : 1)) / maxDataCount : 1);
return maxDataCount > 1 ? (base * ratio) / (maxDataCount - 1) : base;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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