Browse Source

Fix axis.y.center

pull/813/head
Masayuki Tanaka 10 years ago
parent
commit
951696eea1
  1. 4
      c3.js
  2. 4
      c3.min.js
  3. 4
      src/domain.js

4
c3.js

@ -1361,9 +1361,9 @@
domainLength = Math.abs(yDomainMax - yDomainMin);
padding = padding_top = padding_bottom = domainLength * 0.1;
if (center) {
if (typeof center !== 'undefined') {
yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
yDomainMax = yDomainAbs - center;
yDomainMax = center + yDomainAbs;
yDomainMin = center - yDomainAbs;
}
// add padding for data label

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
src/domain.js

@ -112,9 +112,9 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
domainLength = Math.abs(yDomainMax - yDomainMin);
padding = padding_top = padding_bottom = domainLength * 0.1;
if (center) {
if (typeof center !== 'undefined') {
yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
yDomainMax = yDomainAbs - center;
yDomainMax = center + yDomainAbs;
yDomainMin = center - yDomainAbs;
}
// add padding for data label

Loading…
Cancel
Save