add horizontal bar parameter

This commit is contained in:
wxwdesign
2016-10-22 21:17:21 +08:00
parent b3faeb4f2b
commit ddb47ff63a

View File

@@ -49,12 +49,12 @@ export default Vue.extend({
}, },
methods: { methods: {
renderChart (data, options) { renderChart (data, options, type) {
let chartOptions = mergeOptions(this.defaultOptions, options) let chartOptions = mergeOptions(this.defaultOptions, options)
this._chart = new Chart( this._chart = new Chart(
this.$refs.canvas.getContext('2d'), { this.$refs.canvas.getContext('2d'), {
type: 'bar', type: type || 'bar',
data: data, data: data,
options: chartOptions options: chartOptions
} }