Created
April 13, 2019 11:53
-
-
Save linxinemily/e7950a1c46d96f092d5131489c829293 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { Line, mixins } from 'vue-chartjs' | |
const { reactiveProp } = mixins | |
export default { | |
mixins: [reactiveProp], | |
extends: Line, | |
data: () => ({ | |
options: { | |
responsive: true, | |
maintainAspectRatio: false, | |
scales: { | |
yAxes: [ | |
{ | |
ticks: { | |
stepSize: 1 | |
} | |
} | |
] | |
} | |
} | |
}), | |
mounted() { | |
this.renderLineChart() | |
}, | |
methods: { | |
renderLineChart() { | |
this.renderChart(this.chartData, this.options) | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment