Browse Source
Merge pull request #9447 from rusikv/bug/no-data-to-dislplay
Fixed message 'No data to display on widget' not displayed
pull/9473/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts
-
ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.component.ts
|
|
|
@ -116,7 +116,7 @@ export class AggregatedValueCardWidgetComponent implements OnInit, AfterViewInit |
|
|
|
ngOnInit(): void { |
|
|
|
this.ctx.$scope.aggregatedValueCardWidget = this; |
|
|
|
this.settings = {...aggregatedValueCardDefaultSettings, ...this.ctx.settings}; |
|
|
|
this.showSubtitle = this.settings.showSubtitle; |
|
|
|
this.showSubtitle = this.settings.showSubtitle && this.ctx.datasources?.length > 0; |
|
|
|
const subtitle = this.settings.subtitle; |
|
|
|
this.subtitle$ = this.ctx.registerLabelPattern(subtitle, this.subtitle$); |
|
|
|
this.subtitleStyle = textStyle(this.settings.subtitleFont); |
|
|
|
@ -156,7 +156,7 @@ export class AggregatedValueCardWidgetComponent implements OnInit, AfterViewInit |
|
|
|
} |
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
if (this.showChart) { |
|
|
|
if (this.showChart && this.ctx.datasources?.length) { |
|
|
|
const settings = { |
|
|
|
shadowSize: 0, |
|
|
|
enableSelection: false, |
|
|
|
|
|
|
|
@ -60,7 +60,9 @@ export class FlotWidgetComponent implements OnInit { |
|
|
|
this.settings = this.ctx.settings; |
|
|
|
this.chartType = this.chartType || 'line'; |
|
|
|
this.configureLegend(); |
|
|
|
this.flot = new TbFlot(this.ctx, this.chartType, $(this.flotElement.nativeElement)); |
|
|
|
if (this.ctx.datasources?.length) { |
|
|
|
this.flot = new TbFlot(this.ctx, this.chartType, $(this.flotElement.nativeElement)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private configureLegend(): void { |
|
|
|
|