forked from epicmaxco/vuestic-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
deba390
commit 238cf1b
Showing
7 changed files
with
198 additions
and
2 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
src/components/statistics/charts/vuestic-horizontal-bars/HorizontalBarChart.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {HorizontalBar} from 'vue-chartjs' | ||
|
||
export default HorizontalBar.extend({ | ||
props: ['data', 'options'], | ||
|
||
data () { | ||
return { | ||
defaultOptions: { | ||
legend: { | ||
position: 'bottom', | ||
labels: { | ||
fontColor: '#34495e', | ||
fontFamily: 'sans-serif', | ||
fontSize: 14, | ||
padding: 20, | ||
usePointStyle: true | ||
} | ||
}, | ||
tooltips: { | ||
bodyFontSize: 14, | ||
bodyFontFamily: 'sans-serif' | ||
}, | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
} | ||
}, | ||
|
||
mounted () { | ||
let options = Object.assign({}, this.defaultOptions, this.options) | ||
this.renderChart(this.data, options) | ||
} | ||
}) |
15 changes: 15 additions & 0 deletions
15
src/components/statistics/charts/vuestic-horizontal-bars/HorizontalBarChartData.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], | ||
datasets: [ | ||
{ | ||
label: 'Vuestic Satisfaction Score', | ||
backgroundColor: '#f7cc36', | ||
data: [80, 90, 50, 70, 60, 90, 50, 90, 80, 40, 72, 93] | ||
}, | ||
{ | ||
label: 'Bulma Satisfaction Score', | ||
backgroundColor: '#e34a4a', | ||
data: [20, 30, 20, 40, 50, 40, 15, 60, 30, 20, 42, 53] | ||
} | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
src/components/statistics/charts/vuestic-horizontal-bars/VuesticHorizontalBarChart.vue
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div class='donut-chart'> | ||
<horizontal-bar-chart :options="options" :data="data"></horizontal-bar-chart> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import HorizontalBarChart from './HorizontalBarChart' | ||
export default { | ||
name: 'vuestic-vertical-bar-chart', | ||
props: ['data', 'options'], | ||
components: { | ||
HorizontalBarChart | ||
} | ||
} | ||
</script> | ||
|
||
<style lang='scss'> | ||
@import '../../../../sass/_variables.scss'; | ||
.donut-chart { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
> * { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
canvas { | ||
width: 100%; | ||
height: auto; | ||
} | ||
} | ||
</style> |
33 changes: 33 additions & 0 deletions
33
src/components/statistics/charts/vuestic-vertical-bars/VerticalBarChart.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {Bar} from 'vue-chartjs' | ||
|
||
export default Bar.extend({ | ||
props: ['data', 'options'], | ||
|
||
data () { | ||
return { | ||
defaultOptions: { | ||
legend: { | ||
position: 'bottom', | ||
labels: { | ||
fontColor: '#34495e', | ||
fontFamily: 'sans-serif', | ||
fontSize: 14, | ||
padding: 20, | ||
usePointStyle: true | ||
} | ||
}, | ||
tooltips: { | ||
bodyFontSize: 14, | ||
bodyFontFamily: 'sans-serif' | ||
}, | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
} | ||
}, | ||
|
||
mounted () { | ||
let options = Object.assign({}, this.defaultOptions, this.options) | ||
this.renderChart(this.data, options) | ||
} | ||
}) |
15 changes: 15 additions & 0 deletions
15
src/components/statistics/charts/vuestic-vertical-bars/VerticalBarChartData.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], | ||
datasets: [ | ||
{ | ||
label: 'USA', | ||
backgroundColor: '#4ae387', | ||
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11] | ||
}, | ||
{ | ||
label: 'USSR', | ||
backgroundColor: '#4ab2e3', | ||
data: [50, 10, 22, 39, 15, 20, 85, 32, 60, 50, 20, 30] | ||
} | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
src/components/statistics/charts/vuestic-vertical-bars/VuesticVerticalBarChart.vue
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div class='donut-chart'> | ||
<vertical-bar-chart :options="options" :data="data"></vertical-bar-chart> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import VerticalBarChart from './VerticalBarChart' | ||
export default { | ||
name: 'vuestic-vertical-bar-chart', | ||
props: ['data', 'options'], | ||
components: { | ||
VerticalBarChart | ||
} | ||
} | ||
</script> | ||
|
||
<style lang='scss'> | ||
@import '../../../../sass/_variables.scss'; | ||
.donut-chart { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
> * { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
canvas { | ||
width: 100%; | ||
height: auto; | ||
} | ||
} | ||
</style> |