import * as Vue from "vue"; import { Chart, DoughnutController, ArcElement } from "chart.js"; import { PlayCount } from "scripts/HubInterfaces"; Chart.register(DoughnutController, ArcElement); const pieColours = ['#7a99c2', '#a34c77', '#598556', ]; export let ArtistBreakdownChartCard: Vue.Component = { props: ['play_count'], data() { return { } }, computed: { trackPercent() { return this.play_count.track * 100 / this.play_count.artist }, albumPercent() { return this.play_count.album * 100 / this.play_count.artist }, albumDiff() { return this.albumPercent - this.trackPercent; }, artistPercent() { return 100 - this.albumDiff - this.trackPercent; } }, template: `