@@ -2,6 +2,7 @@ import {afterRenderEffect, Component, ElementRef, inject, input, viewChild} from
2
2
import { RunGroup } from '../../../../../runner/shared-interfaces' ;
3
3
import { GoogleChartsLoader } from '../../services/google-charts-loader' ;
4
4
import { AppResizeNotifier } from '../../services/app-resize-notifier' ;
5
+ import { AppColorMode } from '../../services/app-color-mode' ;
5
6
6
7
@Component ( {
7
8
selector : 'score-visualization' ,
@@ -10,6 +11,7 @@ import {AppResizeNotifier} from '../../services/app-resize-notifier';
10
11
export class ScoreVisualization {
11
12
private googleChartsLoader = inject ( GoogleChartsLoader ) ;
12
13
private notifier = inject ( AppResizeNotifier ) ;
14
+ private colorModeService = inject ( AppColorMode ) ;
13
15
14
16
readonly groups = input . required < RunGroup [ ] > ( ) ;
15
17
readonly chartContainer = viewChild . required < ElementRef > ( 'chart' ) ;
@@ -57,6 +59,7 @@ export class ScoreVisualization {
57
59
// Note: we need to call `_processData` synchronously
58
60
// so the wrapping effect picks up the data dependency.
59
61
const { dataRows, averageAppsCount} = this . _processData ( ) ;
62
+ const colorMode = this . colorModeService . colorMode ( ) ;
60
63
61
64
await this . googleChartsLoader . ready ;
62
65
@@ -77,19 +80,29 @@ export class ScoreVisualization {
77
80
) ;
78
81
79
82
const chart = new google . visualization . LineChart ( this . chartContainer ( ) . nativeElement ) ;
83
+ const textColor = colorMode === 'dark' ? '#f9fafb' : '#1e293b' ;
84
+
80
85
chart . draw ( table , {
81
86
curveType : 'function' ,
82
87
title : `Score average over time (~${ averageAppsCount . toFixed ( 0 ) } apps generated per day)` ,
88
+ titleTextStyle : { color : textColor } ,
89
+ backgroundColor : 'transparent' ,
83
90
vAxis : {
84
91
format : 'percent' ,
92
+ viewWindowMode : 'maximized' ,
93
+ textStyle : { color : textColor } ,
94
+ maxValue : 1 ,
85
95
} ,
96
+ legend : { textStyle : { color : textColor } } ,
86
97
hAxis : {
87
98
minTextSpacing : 20 ,
88
- textStyle : { fontSize : 10 } ,
99
+ textStyle : { fontSize : 10 , color : textColor } ,
89
100
} ,
90
101
chartArea : {
91
102
left : 50 ,
92
- right : 300 ,
103
+ right : 155 ,
104
+ bottom : 10 ,
105
+ top : 50 ,
93
106
} ,
94
107
// TODO: Consider enabling trendlines.
95
108
// trendlines: { 0: {}, 1: {} },
0 commit comments