[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

@@ -169,7 +169,6 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
}
this.mempoolVsizeFeesOptions = {
backgroundColor: '#11131f',
series: this.inverted ? [...seriesGraph].reverse() : seriesGraph,
hover: true,
color: this.inverted ? [...newColors].reverse() : newColors,
@@ -397,13 +396,15 @@ export class MempoolGraphComponent implements OnInit, OnChanges {
const now = new Date();
// @ts-ignore
this.mempoolVsizeFeesOptions.grid.height = prevHeight + 20;
this.mempoolVsizeFeesOptions.backgroundColor = '#11131f';
this.chartInstance.setOption(this.mempoolVsizeFeesOptions);
download(this.chartInstance.getDataURL({
pixelRatio: 2,
excludeComponents: ['dataZoom'],
}), `mempool-graph-${timespan}-${now.getTime() / 1000}`);
}), `mempool-graph-${timespan}-${Math.round(now.getTime() / 1000)}.svg`);
// @ts-ignore
this.mempoolVsizeFeesOptions.grid.height = prevHeight;
this.mempoolVsizeFeesOptions.backgroundColor = 'none';
this.chartInstance.setOption(this.mempoolVsizeFeesOptions);
}
}