From 94009b248b5148eee10953996a83d091932fbca9 Mon Sep 17 00:00:00 2001 From: SegFaultx64 Date: Fri, 20 Feb 2015 18:29:25 -0500 Subject: [PATCH] Add the ability to load data with colors --- src/api.load.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api.load.js b/src/api.load.js index e186f89..6bb4c9a 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 colors if exists + if ('colors' in args) { + Object.keys(args.colors).forEach(function (id) { + config.data_colors[id] = args.colors[id]; + }); + } // use cache if exists if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) { $$.load($$.getCaches(args.cacheIds), args.done);