From 51ccc4b4bd1609805e915c75d3e2d589fe590fb2 Mon Sep 17 00:00:00 2001 From: Michel Beloshitsky Date: Thu, 3 Sep 2015 23:52:24 +0500 Subject: [PATCH] Added posibility to update names in load API call --- src/api.load.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api.load.js b/src/api.load.js index 6bb4c9a..d6997b5 100644 --- a/src/api.load.js +++ b/src/api.load.js @@ -20,6 +20,12 @@ c3_chart_fn.load = function (args) { config.data_axes[id] = args.axes[id]; }); } + // update names if exists + if ('names' in args) { + Object.keys(args.names).forEach(function (id) { + config.data_names[id] = args.names[id]; + }); + } // update colors if exists if ('colors' in args) { Object.keys(args.colors).forEach(function (id) {