[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 73406d36b0
commit 60ed32ffe8
10 changed files with 55 additions and 46 deletions

View File

@@ -62,7 +62,6 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges {
mountChart(): void {
this.mempoolStatsChartOption = {
backgroundColor: '#11131f',
grid: {
height: this.height,
right: this.right,
@@ -240,13 +239,15 @@ export class IncomingTransactionsGraphComponent implements OnInit, OnChanges {
const now = new Date();
// @ts-ignore
this.mempoolStatsChartOption.grid.height = prevHeight + 20;
this.mempoolStatsChartOption.backgroundColor = '#11131f';
this.chartInstance.setOption(this.mempoolStatsChartOption);
download(this.chartInstance.getDataURL({
pixelRatio: 2,
excludeComponents: ['dataZoom'],
}), `incoming-vbytes-${timespan}-${now.getTime() / 1000}`);
}), `incoming-vbytes-${timespan}-${Math.round(now.getTime() / 1000)}.svg`);
// @ts-ignore
this.mempoolStatsChartOption.grid.height = prevHeight;
this.mempoolStatsChartOption.backgroundColor = 'none';
this.chartInstance.setOption(this.mempoolStatsChartOption);
}
}