mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
✨ Add LineChart Example component
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<bar-example :width="100" :height="200" :player={wins:'12'} :opponent={wins:'23'}></bar-example>
|
||||
<line-example></line-example>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BarExample from './examples/BarExample'
|
||||
import LineExample from './examples/LineExample'
|
||||
|
||||
export default {
|
||||
components: { BarExample }
|
||||
components: { BarExample, LineExample }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
16
src/examples/LineExample.js
Normal file
16
src/examples/LineExample.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import LineChart from '../BaseCharts/Line'
|
||||
|
||||
export default LineChart.extend({
|
||||
ready () {
|
||||
this.render({
|
||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Data One',
|
||||
backgroundColor: '#f87979',
|
||||
data: [40, 39, 10, 40, 39, 80, 40]
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user