Update charts
This commit is contained in:
+49
-3
@@ -536,12 +536,26 @@ export class SeriesProgressChartComponent implements OnInit, OnDestroy {
|
|||||||
s.name.length > 25 ? s.name.substring(0, 22) + '...' : s.name
|
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 =>
|
const readingPercentages = this.chartSeries.map(s =>
|
||||||
s.booksOwned > 0 ? Math.round((s.booksReading / s.booksOwned) * 100) : 0
|
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 =>
|
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({
|
this.chartDataSubject.next({
|
||||||
@@ -563,10 +577,42 @@ export class SeriesProgressChartComponent implements OnInit, OnDestroy {
|
|||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderRadius: 2
|
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',
|
label: 'Unread',
|
||||||
data: unreadPercentages,
|
data: unreadPercentages,
|
||||||
backgroundColor: 'rgba(158, 158, 158, 0.4)',
|
backgroundColor: 'rgba(158, 158, 158, 0.3)',
|
||||||
borderColor: '#9e9e9e',
|
borderColor: '#9e9e9e',
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderRadius: 2
|
borderRadius: 2
|
||||||
|
|||||||
@@ -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: '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: '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: '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: 'rating-taste', title: 'Rating Taste Comparison', component: RatingTasteChartComponent, enabled: true, sizeClass: 'chart-medium', order: 10},
|
||||||
{id: 'reading-habits', title: 'Reading Habits Analysis', component: ReadingHabitsChartComponent, enabled: true, sizeClass: 'chart-medium', order: 11},
|
{id: 'series-progress', title: 'Series Progress Tracker', component: SeriesProgressChartComponent, enabled: true, sizeClass: 'chart-medium', order: 11},
|
||||||
{id: 'rating-taste', title: 'Rating Taste Comparison', component: RatingTasteChartComponent, enabled: true, sizeClass: 'chart-medium', order: 12},
|
{id: 'reading-dna', title: 'Reading DNA Profile', component: ReadingDNAChartComponent, enabled: true, sizeClass: 'chart-medium', order: 12},
|
||||||
{id: 'series-progress', title: 'Series Progress Tracker', component: SeriesProgressChartComponent, enabled: true, sizeClass: 'chart-medium', order: 13},
|
{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},
|
{id: 'reading-backlog', title: 'Reading Backlog Analysis', component: ReadingBacklogChartComponent, enabled: true, sizeClass: 'chart-full', order: 14},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user