+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts
index b69b023d34..f61a130e9d 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts
@@ -88,7 +88,8 @@ export class BarChartWithLabelsWidgetSettingsComponent extends WidgetSettingsCom
tooltipBackgroundColor: [settings.tooltipBackgroundColor, []],
tooltipBackgroundBlur: [settings.tooltipBackgroundBlur, []],
- background: [settings.background, []]
+ background: [settings.background, []],
+ padding: [settings.padding, []]
});
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.html
index cf5bbcfdd5..4a7331d4c2 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.html
@@ -144,5 +144,11 @@
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.scss
index de2ca546fc..d956173281 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.scss
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.scss
@@ -19,8 +19,10 @@
position: relative;
display: flex;
flex-direction: column;
- gap: 16px;
- padding: 20px 24px 24px 24px;
+ gap: 8px;
+ &.overlay {
+ padding: 20px 24px 24px 24px;
+ }
> div:not(.tb-range-chart-overlay) {
z-index: 1;
}
@@ -40,7 +42,7 @@
min-height: 0;
display: flex;
flex-direction: column;
- gap: 16px;
+ gap: 8px;
&.legend-top {
flex-direction: column-reverse;
}
@@ -88,8 +90,9 @@
}
}
&.legend-right, &.legend-left {
- gap: 24px;
+ gap: 16px;
.tb-range-chart-legend {
+ padding-top: 8px;
flex-direction: column-reverse;
justify-content: flex-end;
align-items: stretch;
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts
index 42c72d6526..9d89154111 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.component.ts
@@ -73,6 +73,8 @@ export class RangeChartWidgetComponent implements OnInit, OnDestroy, AfterViewIn
backgroundStyle$: Observable;
overlayStyle: ComponentStyle = {};
+ overlayEnabled: boolean;
+ padding: string;
legendLabelStyle: ComponentStyle;
disabledLegendLabelStyle: ComponentStyle;
@@ -110,6 +112,8 @@ export class RangeChartWidgetComponent implements OnInit, OnDestroy, AfterViewIn
this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer);
this.overlayStyle = overlayStyle(this.settings.background.overlay);
+ this.overlayEnabled = this.settings.background.overlay.enabled;
+ this.padding = this.overlayEnabled ? undefined : this.settings.padding;
this.rangeItems = toRangeItems(this.settings.rangeColors);
this.visibleRangeItems = this.rangeItems.filter(item => item.visible);
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.models.ts
index bff0c8fb1b..ee7b2835e6 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.models.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.models.ts
@@ -60,6 +60,7 @@ export interface RangeChartWidgetSettings extends EChartsTooltipWidgetSettings {
legendLabelFont: Font;
legendLabelColor: string;
background: BackgroundSettings;
+ padding: string;
}
export const rangeChartDefaultSettings: RangeChartWidgetSettings = {
@@ -118,7 +119,8 @@ export const rangeChartDefaultSettings: RangeChartWidgetSettings = {
color: 'rgba(255,255,255,0.72)',
blur: 3
}
- }
+ },
+ padding: '12px'
};
export const rangeChartTimeSeriesSettings = (settings: RangeChartWidgetSettings, rangeItems: RangeItem[],
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts
index 4abd10a6e3..df8b74f898 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts
@@ -333,7 +333,10 @@ export class TbTimeSeriesChart {
timeSeriesChartKeyDefaultSettings, dataKey.settings);
if ((keySettings.type === TimeSeriesChartSeriesType.line && keySettings.lineSettings.showPointLabel &&
keySettings.lineSettings.pointLabelPosition === SeriesLabelPosition.top) ||
- (keySettings.type === TimeSeriesChartSeriesType.bar && keySettings.barSettings.showLabel)) {
+ (keySettings.type === TimeSeriesChartSeriesType.bar &&
+ keySettings.barSettings.showLabel &&
+ [SeriesLabelPosition.top, SeriesLabelPosition.bottom]
+ .includes(keySettings.barSettings.labelPosition as SeriesLabelPosition))) {
this.topPointLabels = true;
}
dataKey.settings = keySettings;
@@ -366,6 +369,11 @@ export class TbTimeSeriesChart {
for (const thresholdSettings of this.settings.thresholds) {
const threshold = mergeDeep({} as TimeSeriesChartThreshold,
timeSeriesChartThresholdDefaultSettings, thresholdSettings);
+ if (!this.topPointLabels) {
+ if (threshold.showLabel && !threshold.labelPosition.endsWith('Bottom')) {
+ this.topPointLabels = true;
+ }
+ }
let latestDataKey: DataKey = null;
let entityDataKey: DataKey = null;
let value = null;
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.html
index b20b941bd1..bc8044b957 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.html
@@ -154,5 +154,11 @@
+
+
+
+
+
{{ 'widget-config.card-padding' | translate }}
+
+
+
+
+
{{ 'widget-config.card-padding' | translate }}
+