mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
Merge pull request #166 from dsbert/patch-1
Add support for xLabels and yLabels
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
"e2e": "node test/e2e/runner.js",
|
"e2e": "node test/e2e/runner.js",
|
||||||
"test": "npm run unit",
|
"test": "npm run unit",
|
||||||
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
|
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
|
||||||
"release": "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js && webpack --progress --hide-modules --config ./build/webpack.release.full.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.full.min.js",
|
"release": "webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js && webpack --progress --hide-modules --config ./build/webpack.release.full.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.full.min.js",
|
||||||
"prepublish": "yarn run lint && yarn run test && yarn run build"
|
"prepublish": "yarn run lint && yarn run test && yarn run build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -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()
|
chart.update()
|
||||||
} else {
|
} else {
|
||||||
chart.destroy()
|
chart.destroy()
|
||||||
|
|||||||
@@ -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()
|
chart.update()
|
||||||
} else {
|
} else {
|
||||||
chart.destroy()
|
chart.destroy()
|
||||||
|
|||||||
Reference in New Issue
Block a user