@@ -2,6 +2,7 @@ import {afterRenderEffect, Component, ElementRef, inject, input, viewChild} from
22import { RunGroup } from '../../../../../runner/shared-interfaces' ;
33import { GoogleChartsLoader } from '../../services/google-charts-loader' ;
44import { AppResizeNotifier } from '../../services/app-resize-notifier' ;
5+ import { AppColorMode } from '../../services/app-color-mode' ;
56
67@Component ( {
78 selector : 'score-visualization' ,
@@ -10,6 +11,7 @@ import {AppResizeNotifier} from '../../services/app-resize-notifier';
1011export class ScoreVisualization {
1112 private googleChartsLoader = inject ( GoogleChartsLoader ) ;
1213 private notifier = inject ( AppResizeNotifier ) ;
14+ private colorModeService = inject ( AppColorMode ) ;
1315
1416 readonly groups = input . required < RunGroup [ ] > ( ) ;
1517 readonly chartContainer = viewChild . required < ElementRef > ( 'chart' ) ;
@@ -57,6 +59,7 @@ export class ScoreVisualization {
5759 // Note: we need to call `_processData` synchronously
5860 // so the wrapping effect picks up the data dependency.
5961 const { dataRows, averageAppsCount} = this . _processData ( ) ;
62+ const colorMode = this . colorModeService . colorMode ( ) ;
6063
6164 await this . googleChartsLoader . ready ;
6265
@@ -77,19 +80,29 @@ export class ScoreVisualization {
7780 ) ;
7881
7982 const chart = new google . visualization . LineChart ( this . chartContainer ( ) . nativeElement ) ;
83+ const textColor = colorMode === 'dark' ? '#f9fafb' : '#1e293b' ;
84+
8085 chart . draw ( table , {
8186 curveType : 'function' ,
8287 title : `Score average over time (~${ averageAppsCount . toFixed ( 0 ) } apps generated per day)` ,
88+ titleTextStyle : { color : textColor } ,
89+ backgroundColor : 'transparent' ,
8390 vAxis : {
8491 format : 'percent' ,
92+ viewWindowMode : 'maximized' ,
93+ textStyle : { color : textColor } ,
94+ maxValue : 1 ,
8595 } ,
96+ legend : { textStyle : { color : textColor } } ,
8697 hAxis : {
8798 minTextSpacing : 20 ,
88- textStyle : { fontSize : 10 } ,
99+ textStyle : { fontSize : 10 , color : textColor } ,
89100 } ,
90101 chartArea : {
91102 left : 50 ,
92- right : 300 ,
103+ right : 155 ,
104+ bottom : 10 ,
105+ top : 50 ,
93106 } ,
94107 // TODO: Consider enabling trendlines.
95108 // trendlines: { 0: {}, 1: {} },
0 commit comments