Browse Source

Merge branch 'santazhang-api-query-axis-range'

pull/555/head
Masayuki Tanaka 10 years ago
parent
commit
88ac4618cf
  1. 17
      c3.js
  2. 2
      c3.min.js
  3. 17
      src/api.axis.js

17
c3.js

@ -5987,6 +5987,12 @@
config.axis_y_max = config.axis_y2_max = max; config.axis_y_max = config.axis_y2_max = max;
} }
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true}); $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
} else {
return {
x: config.axis_x_max,
y: config.axis_y_max,
y2: config.axis_y2_max
};
} }
}; };
c3_chart_fn.axis.min = function (min) { c3_chart_fn.axis.min = function (min) {
@ -6000,12 +6006,23 @@
config.axis_y_min = config.axis_y2_min = min; config.axis_y_min = config.axis_y2_min = min;
} }
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true}); $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
} else {
return {
x: config.axis_x_min,
y: config.axis_y_min,
y2: config.axis_y2_min
};
} }
}; };
c3_chart_fn.axis.range = function (range) { c3_chart_fn.axis.range = function (range) {
if (arguments.length) { if (arguments.length) {
if (isDefined(range.max)) { this.axis.max(range.max); } if (isDefined(range.max)) { this.axis.max(range.max); }
if (isDefined(range.min)) { this.axis.min(range.min); } if (isDefined(range.min)) { this.axis.min(range.min); }
} else {
return {
max: this.axis.max(),
min: this.axis.min()
};
} }
}; };

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

17
src/api.axis.js

@ -20,6 +20,12 @@ c3_chart_fn.axis.max = function (max) {
config.axis_y_max = config.axis_y2_max = max; config.axis_y_max = config.axis_y2_max = max;
} }
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true}); $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
} else {
return {
x: config.axis_x_max,
y: config.axis_y_max,
y2: config.axis_y2_max
};
} }
}; };
c3_chart_fn.axis.min = function (min) { c3_chart_fn.axis.min = function (min) {
@ -33,11 +39,22 @@ c3_chart_fn.axis.min = function (min) {
config.axis_y_min = config.axis_y2_min = min; config.axis_y_min = config.axis_y2_min = min;
} }
$$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true}); $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
} else {
return {
x: config.axis_x_min,
y: config.axis_y_min,
y2: config.axis_y2_min
};
} }
}; };
c3_chart_fn.axis.range = function (range) { c3_chart_fn.axis.range = function (range) {
if (arguments.length) { if (arguments.length) {
if (isDefined(range.max)) { this.axis.max(range.max); } if (isDefined(range.max)) { this.axis.max(range.max); }
if (isDefined(range.min)) { this.axis.min(range.min); } if (isDefined(range.min)) { this.axis.min(range.min); }
} else {
return {
max: this.axis.max(),
min: this.axis.min()
};
} }
}; };

Loading…
Cancel
Save