diff --git a/src/components/charts/HistoryAllPrintStatusChart.vue b/src/components/charts/HistoryAllPrintStatusChart.vue index 98df21772..892c787f4 100644 --- a/src/components/charts/HistoryAllPrintStatusChart.vue +++ b/src/components/charts/HistoryAllPrintStatusChart.vue @@ -56,7 +56,7 @@ export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin, ThemeM series: [ { type: 'pie', - data: this.printStatusArray, + data: this.groupedPrintStatusArray, avoidLabelOverlap: false, radius: ['35%', '60%'], emphasis: { @@ -83,8 +83,8 @@ export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin, ThemeM if (this.chart) this.chart.dispose() } - @Watch('printStatusArray') - printStatusArrayChanged(newVal: any) { + @Watch('groupedPrintStatusArray') + groupedPrintStatusArrayChanged(newVal: any) { this.chart?.setOption( { series: { diff --git a/src/components/mixins/historyStats.ts b/src/components/mixins/historyStats.ts index 831e79114..e761a993e 100644 --- a/src/components/mixins/historyStats.ts +++ b/src/components/mixins/historyStats.ts @@ -106,7 +106,7 @@ export default class HistoryStatsMixin extends Vue { const countSelected = this.$store.getters['server/history/getSelectedJobs'].length const orgArray = countSelected ? this.selectedPrintStatusChartData : this.allPrintStatusChartData - const output = orgArray.map((status) => ({ + return orgArray.map((status) => ({ ...status, name: status.displayName, value: @@ -116,7 +116,9 @@ export default class HistoryStatsMixin extends Vue { ? status.valueTime : status.value, })) + } - return this.groupSmallEntries(output, 0.05) + get groupedPrintStatusArray() { + return this.groupSmallEntries(this.printStatusArray, 0.05) } } diff --git a/src/components/panels/HistoryListPanel.vue b/src/components/panels/HistoryListPanel.vue index 85b2b404f..a796e18cd 100644 --- a/src/components/panels/HistoryListPanel.vue +++ b/src/components/panels/HistoryListPanel.vue @@ -80,11 +80,8 @@ @change="showPrintJobs = !showPrintJobs" /> -