From 4b48ee48a4a832e36a1c589398c6f78e67b33e3a Mon Sep 17 00:00:00 2001 From: Tim Routowicz Date: Thu, 17 Sep 2015 12:22:34 -0400 Subject: [PATCH] Fix scaleless chart updates PR #17 did not account for charts without scales. --- lib/core.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core.js b/lib/core.js index 08a2f17..5cbb2e8 100644 --- a/lib/core.js +++ b/lib/core.js @@ -42,8 +42,12 @@ module.exports = { } else { dataKey = dataKey || dataKeys[chart.name]; updatePoints(nextProps, chart, dataKey); - chart.scale.xLabels = nextProps.data.labels; - chart.scale.calculateXLabelRotation(); + + if (chart.scale) { + chart.scale.xLabels = nextProps.data.labels; + chart.scale.calculateXLabelRotation(); + } + chart.update(); } };