Skip to content

Instantly share code, notes, and snippets.

@windate3411
Created January 22, 2020 12:56
Show Gist options
  • Save windate3411/03a7e202615134ad263f6938dc4b345d to your computer and use it in GitHub Desktop.
Save windate3411/03a7e202615134ad263f6938dc4b345d to your computer and use it in GitHub Desktop.
src/components/BarChart.vue
<script>
import { Bar } from 'vue-chartjs'
export default {
extends: Bar,
mounted() {
this.renderChart({
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
datasets: [
{
label: 'GitHub Commits',
backgroundColor: '#f87979',
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11]
}
]
})
}
}
</script>
src/App.vue
<div class="col-md-5 mr-2">
<div class="card h-100">
<BarChart />
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment