Browse Source

UI: Minor fixes.

pull/13033/head
Igor Kulikov 2 years ago
parent
commit
dedf3db928
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.ts
  2. 2
      ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts
  3. 2
      ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.ts

@ -223,6 +223,7 @@ export abstract class TbLatestChart<S extends LatestChartSettings> {
} }
protected updateSeriesData(initial = false) { protected updateSeriesData(initial = false) {
if (!this.latestChart.isDisposed()) {
this.total = 0; this.total = 0;
this.totalText = 'N/A'; this.totalText = 'N/A';
let hasValue = false; let hasValue = false;
@ -258,6 +259,7 @@ export abstract class TbLatestChart<S extends LatestChartSettings> {
this.latestChart.setOption(this.latestChartOption); this.latestChart.setOption(this.latestChartOption);
this.afterUpdateSeriesData(initial); this.afterUpdateSeriesData(initial);
} }
}
private drawChart() { private drawChart() {
echartsModule.init(); echartsModule.init();

2
ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts

@ -690,6 +690,7 @@ export class TbTimeSeriesChart {
} }
private updateSeriesData(updateScale = false): void { private updateSeriesData(updateScale = false): void {
if (!this.timeSeriesChart.isDisposed()) {
this.updateSeries(); this.updateSeries();
if (updateScale && this.updateYAxisScale(this.yAxisList)) { if (updateScale && this.updateYAxisScale(this.yAxisList)) {
this.timeSeriesChartOptions.yAxis = this.yAxisList.map(axis => axis.option); this.timeSeriesChartOptions.yAxis = this.yAxisList.map(axis => axis.option);
@ -697,6 +698,7 @@ export class TbTimeSeriesChart {
this.timeSeriesChart.setOption(this.timeSeriesChartOptions); this.timeSeriesChart.setOption(this.timeSeriesChartOptions);
this.updateAxes(); this.updateAxes();
} }
}
private updateSeries(): void { private updateSeries(): void {
this.timeSeriesChartOptions.series = generateChartData(this.dataItems, this.thresholdItems, this.timeSeriesChartOptions.series = generateChartData(this.dataItems, this.thresholdItems,

2
ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

@ -468,6 +468,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
const resizable = item.resize; const resizable = item.resize;
if (resizable) {
this.heightValue = resizable.height; this.heightValue = resizable.height;
this.widthValue = resizable.width; this.widthValue = resizable.width;
@ -511,6 +512,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
} }
} }
}); });
}
this.preserveAspectRatioApplied = true; this.preserveAspectRatioApplied = true;
} }
} }

Loading…
Cancel
Save