Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Admin/Stats.vue
<template> | <template> | ||||
<div id="stats-container" class="container"></div> | <div id="stats-container" class="container"></div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { Chart } from 'frappe-charts/dist/frappe-charts.esm.js' | import { Chart } from 'frappe-charts/dist/frappe-charts.esm.js' | ||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
charts: {}, | charts: {}, | ||||
chartTypes: ['users', 'users-all', 'income', 'discounts'] | chartTypes: ['users', 'users-all', 'income', 'discounts', 'vouchers'] | ||||
} | } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
this.chartTypes.forEach(chart => this.loadChart(chart)) | this.chartTypes.forEach(chart => this.loadChart(chart)) | ||||
}, | }, | ||||
methods: { | methods: { | ||||
drawChart(name, data) { | drawChart(name, data) { | ||||
if (!data.title) { | if (!data.title) { | ||||
Show All 26 Lines |