Skip to content

Instantly share code, notes, and snippets.

@linxinemily
Created April 13, 2019 11:53
Show Gist options
  • Save linxinemily/e7950a1c46d96f092d5131489c829293 to your computer and use it in GitHub Desktop.
Save linxinemily/e7950a1c46d96f092d5131489c829293 to your computer and use it in GitHub Desktop.
<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