Browse Source

Uses previously provided keys if none provided on load

pull/1748/head
Ramin Taleghani 9 years ago
parent
commit
0ec56436cb
  1. 7
      src/data.load.js

7
src/data.load.js

@ -34,7 +34,7 @@ c3_chart_internal_fn.load = function (targets, args) {
if (args.done) { args.done(); }
};
c3_chart_internal_fn.loadFromArgs = function (args) {
var $$ = this;
var $$ = this, config = $$.config;
if (args.data) {
$$.load($$.convertDataToTargets(args.data), args);
}
@ -44,6 +44,11 @@ c3_chart_internal_fn.loadFromArgs = function (args) {
});
}
else if (args.json) {
// If keys not provided use previously saved if available
var existingKeys = config.data_keys;
if (!('keys' in args) && existingKeys) {
args.keys = existingKeys;
}
$$.load($$.convertDataToTargets($$.convertJsonToData(args.json, args.keys)), args);
}
else if (args.rows) {

Loading…
Cancel
Save