mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
fix(dashboard): improve input value for solar chart
This commit is contained in:
parent
0c323f55ef
commit
df7de82737
1 changed files with 14 additions and 4 deletions
|
|
@ -18,7 +18,17 @@ declare const echarts: any;
|
||||||
})
|
})
|
||||||
export class SolarComponent implements AfterViewInit {
|
export class SolarComponent implements AfterViewInit {
|
||||||
|
|
||||||
@Input() chartValue: number;
|
private value: number = 0;
|
||||||
|
|
||||||
|
@Input('chartValue')
|
||||||
|
set chartValue(value: number) {
|
||||||
|
this.value = value;
|
||||||
|
if (this.option.series) {
|
||||||
|
this.option.series[0].data[0].value = value;
|
||||||
|
this.option.series[0].data[1].value = 100 - value;
|
||||||
|
this.option.series[1].data[0].value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
option: any = {};
|
option: any = {};
|
||||||
|
|
||||||
|
|
@ -45,7 +55,7 @@ export class SolarComponent implements AfterViewInit {
|
||||||
radius: solarTheme.radius,
|
radius: solarTheme.radius,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
value: this.chartValue,
|
value: this.value,
|
||||||
name: ' ',
|
name: ' ',
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
normal: {
|
||||||
|
|
@ -82,7 +92,7 @@ export class SolarComponent implements AfterViewInit {
|
||||||
hoverAnimation: false,
|
hoverAnimation: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 100 - this.chartValue,
|
value: 100 - this.value,
|
||||||
name: ' ',
|
name: ' ',
|
||||||
tooltip: {
|
tooltip: {
|
||||||
show: false,
|
show: false,
|
||||||
|
|
@ -109,7 +119,7 @@ export class SolarComponent implements AfterViewInit {
|
||||||
radius: solarTheme.radius,
|
radius: solarTheme.radius,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
value: this.chartValue,
|
value: this.value,
|
||||||
name: ' ',
|
name: ' ',
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
normal: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue