From 1e392091eaf49c840944b085e98d06f57c2e15bf Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 4 Aug 2017 15:06:22 -0400 Subject: [PATCH] Add support for xLabels and yLabels --- src/mixins/reactiveData.js | 10 +++++++++- src/mixins/reactiveProp.js | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mixins/reactiveData.js b/src/mixins/reactiveData.js index b15b49b..6b3ccf8 100644 --- a/src/mixins/reactiveData.js +++ b/src/mixins/reactiveData.js @@ -48,7 +48,15 @@ module.exports = { } }) - chart.data.labels = newData.labels + if (newData.hasOwnProperty('labels')) { + chart.data.labels = newData.labels + } + if (newData.hasOwnProperty('xLabels')) { + chart.data.xLabels = newData.xLabels + } + if (newData.hasOwnProperty('yLabels')) { + chart.data.yLabels = newData.yLabels + } chart.update() } else { chart.destroy() diff --git a/src/mixins/reactiveProp.js b/src/mixins/reactiveProp.js index c9da8ff..e90a27c 100644 --- a/src/mixins/reactiveProp.js +++ b/src/mixins/reactiveProp.js @@ -48,7 +48,15 @@ module.exports = { } }) - chart.data.labels = newData.labels + if (newData.hasOwnProperty('labels')) { + chart.data.labels = newData.labels + } + if (newData.hasOwnProperty('xLabels')) { + chart.data.xLabels = newData.xLabels + } + if (newData.hasOwnProperty('yLabels')) { + chart.data.yLabels = newData.yLabels + } chart.update() } else { chart.destroy()