Make hashrate chart more responsive

This commit is contained in:
nymkappa
2022-02-21 14:02:41 +09:00
parent 53a8d5b246
commit ac118141ce
3 changed files with 51 additions and 8 deletions

View File

@@ -22,12 +22,16 @@ import { FormBuilder, FormGroup } from '@angular/forms';
})
export class HashrateChartComponent implements OnInit {
@Input() widget: boolean = false;
@Input() right: number | string = 10;
@Input() left: number | string = 75;
radioGroupForm: FormGroup;
chartOptions: EChartsOption = {};
chartInitOptions = {
renderer: 'svg'
renderer: 'svg',
width: 'auto',
height: 'auto',
};
hashrateObservable$: Observable<any>;
@@ -73,6 +77,10 @@ export class HashrateChartComponent implements OnInit {
prepareChartOptions(data) {
this.chartOptions = {
grid: {
right: this.right,
left: this.left,
},
title: {
text: this.widget ? '' : $localize`:@@mining.hashrate:Hashrate`,
left: 'center',