Created
October 10, 2019 13:23
-
-
Save mercyikpe/d70e9a47b8dbc410ab81a439bc0001e9 to your computer and use it in GitHub Desktop.
barChart Component
This file contains hidden or 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
<template> | |
<div> | |
<canvas ref="canvas" width="900" height="400"></canvas> | |
</div> | |
</template> | |
<script> | |
// CommitChart.js | |
import { Bar } from 'vue-chartjs' | |
export default { | |
extends: Bar, | |
mounted () { | |
// Overwriting base render method with actual data. | |
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> | |
<style scoped> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment