[Chart download] Add .svg to file name, fix chart background colors

This commit is contained in:
nymkappa
2022-05-09 11:01:51 +02:00
parent c62ed62db6
commit 271f3c2317
10 changed files with 55 additions and 46 deletions

View File

@@ -152,7 +152,6 @@ export class HashrateChartComponent implements OnInit {
}
this.chartOptions = {
backgroundColor: '#11131f',
title: title,
animation: false,
color: [
@@ -359,13 +358,15 @@ export class HashrateChartComponent implements OnInit {
const now = new Date();
// @ts-ignore
this.chartOptions.grid.bottom = 30;
this.chartOptions.backgroundColor = '#11131f';
this.chartInstance.setOption(this.chartOptions);
download(this.chartInstance.getDataURL({
pixelRatio: 2,
excludeComponents: ['dataZoom'],
}), `hashrate-difficulty-${this.timespan}-${now.getTime() / 1000}`);
}), `hashrate-difficulty-${this.timespan}-${Math.round(now.getTime() / 1000)}.svg`);
// @ts-ignore
this.chartOptions.grid.bottom = prevBottom;
this.chartOptions.backgroundColor = 'none';
this.chartInstance.setOption(this.chartOptions);
}
}