尝试使用以下。。。
import { Line } from 'vue-chartjs'
export default Line.extend({
props: ['data', 'options'],
mounted() {
this.renderChart({
labels: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],
datasets: [{
lineTension: 0,
borderWidth: 1,
borderColor: '#F2A727',
pointBackgroundColor: '#F2A727',
backgroundColor: 'transparent',
data: [40, 20, 12, 39, 10, 30]
}]
}, {
legend: {
display: false,
},
scales: {
yAxes: [{
display: false
}]
}
})
}
})
不是“vue chartjs”pro,但AFAIK这应该行得通