Skip to content

Commit

Permalink
Use dark theme colors for charts
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Nov 14, 2023
1 parent 4232911 commit e25edf5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/info/info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h4>
</div>
</div>
<div class="col-auto">
<div echarts [options]="clientVersionsChartOptions" [merge]="clientVersionsChartUpdateOptions" theme="default" class="client-version-chart"></div>
<div echarts [options]="clientVersionsChartOptions" [merge]="clientVersionsChartUpdateOptions" [theme]="chartTheme" class="client-version-chart"></div>
</div>
<div class="col-auto">
<h5>Chart Mode</h5>
Expand Down
21 changes: 13 additions & 8 deletions src/app/info/info.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export class InfoComponent implements OnInit, OnDestroy {
return this.poolsProvider.pool.type === PoolType.nft
}

public get chartTheme(): string {
return this.themeProvider.isDarkTheme ? 'dark' : 'default'
}

protected readonly faCheck = faCheck

private clientVersionsUpdateInterval?: ReturnType<typeof setInterval>
Expand Down Expand Up @@ -62,6 +66,7 @@ export class InfoComponent implements OnInit, OnDestroy {
private readonly themeProvider: ThemeProvider,
) {
this.clientVersionsChartOptions = {
backgroundColor: 'rgba(0,0,0,0)',
title: {
text: 'Client Versions',
left: 'center',
Expand Down Expand Up @@ -116,16 +121,16 @@ export class InfoComponent implements OnInit, OnDestroy {
color: textColor,
},
},
series: [{
label: {
}
if (this.clientVersionsChartUpdateOptions.series !== undefined) {
this.clientVersionsChartUpdateOptions.series[0].label = {
color: textColor,
}
this.clientVersionsChartUpdateOptions.series[0].labelLine = {
lineStyle: {
color: textColor,
},
labelLine: {
lineStyle: {
color: textColor,
},
},
}],
}
}
})
)
Expand Down

0 comments on commit e25edf5

Please sign in to comment.