Browse Source

Add axes argument for load API - #490

pull/631/head
Masayuki Tanaka 10 years ago
parent
commit
9647ddb2c0
  1. 6
      c3.js
  2. 2
      c3.min.js
  3. 6
      src/api.load.js

6
c3.js

@ -5559,6 +5559,12 @@
if ('categories' in args && $$.isCategorized()) { if ('categories' in args && $$.isCategorized()) {
config.axis_x_categories = args.categories; config.axis_x_categories = args.categories;
} }
// update axes if exists
if ('axes' in args) {
Object.keys(args.axes).forEach(function (id) {
config.data_axes[id] = args.axes[id];
});
}
// use cache if exists // use cache if exists
if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) { if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) {
$$.load($$.getCaches(args.cacheIds), args.done); $$.load($$.getCaches(args.cacheIds), args.done);

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

6
src/api.load.js

@ -14,6 +14,12 @@ c3_chart_fn.load = function (args) {
if ('categories' in args && $$.isCategorized()) { if ('categories' in args && $$.isCategorized()) {
config.axis_x_categories = args.categories; config.axis_x_categories = args.categories;
} }
// update axes if exists
if ('axes' in args) {
Object.keys(args.axes).forEach(function (id) {
config.data_axes[id] = args.axes[id];
});
}
// use cache if exists // use cache if exists
if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) { if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) {
$$.load($$.getCaches(args.cacheIds), args.done); $$.load($$.getCaches(args.cacheIds), args.done);

Loading…
Cancel
Save