[Enhancement] Move chart options to a variable (#189)

This commit is contained in:
Moisés Ñañez
2019-10-28 10:30:02 -05:00
committed by Pranav Raj S
parent 17bb50c977
commit 5a41f321c8

View File

@@ -3,11 +3,7 @@ import { Bar } from 'vue-chartjs';
const fontFamily = const fontFamily =
'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
export default { const chartOptions = {
extends: Bar,
props: ['collection'],
mounted() {
this.renderChart(this.collection, {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
legend: { legend: {
@@ -38,6 +34,12 @@ export default {
}, },
], ],
}, },
}); };
export default {
extends: Bar,
props: ['collection'],
mounted() {
this.renderChart(this.collection, chartOptions);
}, },
}; };