From 3afc82e2101da5431acf409024fe215697cb47ea Mon Sep 17 00:00:00 2001 From: acx10 Date: Wed, 21 Jan 2026 09:42:08 -0700 Subject: [PATCH] Update charts --- .../series-progress-chart.component.ts | 52 +++++++++++++++++-- .../service/user-chart-config.service.ts | 8 +-- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/booklore-ui/src/app/features/stats/component/series-progress-chart/series-progress-chart.component.ts b/booklore-ui/src/app/features/stats/component/series-progress-chart/series-progress-chart.component.ts index 476c6b665..6c42ad606 100644 --- a/booklore-ui/src/app/features/stats/component/series-progress-chart/series-progress-chart.component.ts +++ b/booklore-ui/src/app/features/stats/component/series-progress-chart/series-progress-chart.component.ts @@ -536,12 +536,26 @@ export class SeriesProgressChartComponent implements OnInit, OnDestroy { s.name.length > 25 ? s.name.substring(0, 22) + '...' : s.name ); - const readPercentages = this.chartSeries.map(s => s.completionPercentage); + const readPercentages = this.chartSeries.map(s => + s.booksOwned > 0 ? Math.round((s.booksRead / s.booksOwned) * 100) : 0 + ); const readingPercentages = this.chartSeries.map(s => s.booksOwned > 0 ? Math.round((s.booksReading / s.booksOwned) * 100) : 0 ); + const partiallyReadPercentages = this.chartSeries.map(s => + s.booksOwned > 0 ? Math.round((s.booksPartiallyRead / s.booksOwned) * 100) : 0 + ); + const pausedPercentages = this.chartSeries.map(s => + s.booksOwned > 0 ? Math.round((s.booksPaused / s.booksOwned) * 100) : 0 + ); + const abandonedPercentages = this.chartSeries.map(s => + s.booksOwned > 0 ? Math.round((s.booksAbandoned / s.booksOwned) * 100) : 0 + ); + const wontReadPercentages = this.chartSeries.map(s => + s.booksOwned > 0 ? Math.round((s.booksWontRead / s.booksOwned) * 100) : 0 + ); const unreadPercentages = this.chartSeries.map(s => - 100 - s.completionPercentage - (s.booksOwned > 0 ? Math.round((s.booksReading / s.booksOwned) * 100) : 0) + s.booksOwned > 0 ? Math.round((s.booksUnread / s.booksOwned) * 100) : 0 ); this.chartDataSubject.next({ @@ -563,10 +577,42 @@ export class SeriesProgressChartComponent implements OnInit, OnDestroy { borderWidth: 1, borderRadius: 2 }, + { + label: 'Partially Read', + data: partiallyReadPercentages, + backgroundColor: 'rgba(255, 152, 0, 0.85)', + borderColor: '#ff9800', + borderWidth: 1, + borderRadius: 2 + }, + { + label: 'Paused', + data: pausedPercentages, + backgroundColor: 'rgba(33, 150, 243, 0.85)', + borderColor: '#2196f3', + borderWidth: 1, + borderRadius: 2 + }, + { + label: 'Abandoned', + data: abandonedPercentages, + backgroundColor: 'rgba(239, 83, 80, 0.85)', + borderColor: '#ef5350', + borderWidth: 1, + borderRadius: 2 + }, + { + label: 'Won\'t Read', + data: wontReadPercentages, + backgroundColor: 'rgba(158, 158, 158, 0.6)', + borderColor: '#9e9e9e', + borderWidth: 1, + borderRadius: 2 + }, { label: 'Unread', data: unreadPercentages, - backgroundColor: 'rgba(158, 158, 158, 0.4)', + backgroundColor: 'rgba(158, 158, 158, 0.3)', borderColor: '#9e9e9e', borderWidth: 1, borderRadius: 2 diff --git a/booklore-ui/src/app/features/stats/service/user-chart-config.service.ts b/booklore-ui/src/app/features/stats/service/user-chart-config.service.ts index d21935d57..d80fea403 100644 --- a/booklore-ui/src/app/features/stats/service/user-chart-config.service.ts +++ b/booklore-ui/src/app/features/stats/service/user-chart-config.service.ts @@ -42,10 +42,10 @@ export class UserChartConfigService { {id: 'read-status', title: 'Reading Status Distribution', component: ReadStatusChartComponent, enabled: true, sizeClass: 'chart-small-square', order: 7}, {id: 'genre-stats', title: 'Genre Statistics', component: GenreStatsChartComponent, enabled: true, sizeClass: 'chart-medium', order: 8}, {id: 'completion-timeline', title: 'Completion Timeline', component: CompletionTimelineChartComponent, enabled: true, sizeClass: 'chart-medium', order: 9}, - {id: 'reading-dna', title: 'Reading DNA Profile', component: ReadingDNAChartComponent, enabled: true, sizeClass: 'chart-medium', order: 10}, - {id: 'reading-habits', title: 'Reading Habits Analysis', component: ReadingHabitsChartComponent, enabled: true, sizeClass: 'chart-medium', order: 11}, - {id: 'rating-taste', title: 'Rating Taste Comparison', component: RatingTasteChartComponent, enabled: true, sizeClass: 'chart-medium', order: 12}, - {id: 'series-progress', title: 'Series Progress Tracker', component: SeriesProgressChartComponent, enabled: true, sizeClass: 'chart-medium', order: 13}, + {id: 'rating-taste', title: 'Rating Taste Comparison', component: RatingTasteChartComponent, enabled: true, sizeClass: 'chart-medium', order: 10}, + {id: 'series-progress', title: 'Series Progress Tracker', component: SeriesProgressChartComponent, enabled: true, sizeClass: 'chart-medium', order: 11}, + {id: 'reading-dna', title: 'Reading DNA Profile', component: ReadingDNAChartComponent, enabled: true, sizeClass: 'chart-medium', order: 12}, + {id: 'reading-habits', title: 'Reading Habits Analysis', component: ReadingHabitsChartComponent, enabled: true, sizeClass: 'chart-medium', order: 13}, {id: 'reading-backlog', title: 'Reading Backlog Analysis', component: ReadingBacklogChartComponent, enabled: true, sizeClass: 'chart-full', order: 14}, ];