Change chart usage

This commit is contained in:
2021-04-10 17:55:32 +02:00
parent a51fb5d80b
commit 53f5418275
3 changed files with 16 additions and 2 deletions

View File

@@ -52,11 +52,13 @@
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
import { StatResult } from '@/apiary/apiary';
import axios from 'axios';
import Chart from 'chart.js/auto';
import { Chart, ArcElement, Legend, DoughnutController, Title } from 'chart.js';
import randomColor from 'randomcolor';
export type StatType = 'username' | 'password' | 'ip' | 'country' | 'total';
Chart.register(ArcElement, Legend, DoughnutController, Title);
@Component
export default class StatsPie extends Vue {
@Prop() private statType!: StatType;
@@ -161,7 +163,6 @@ export default class StatsPie extends Vue {
type: 'doughnut',
data: {
labels: headers,
options: {},
datasets: [
{
data: values,