Browse Source

Fix event rect width when no data

pull/183/head
Masayuki Tanaka 11 years ago
parent
commit
89049f47cf
  1. 12
      c3.js
  2. 2
      c3.min.js

12
c3.js

@ -549,10 +549,14 @@
}
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(),
ratio = (hasBarType(c3.data.targets) ? (maxDataCount - (isCategorized ? 0.25 : 1)) / maxDataCount : 1);
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;
}
function updateLegendStep(step) {

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save