Browse Source

UI: Improve time series chart tooltip configuration - added font/color settings for tooltip label.

pull/10592/head
Igor Kulikov 2 years ago
parent
commit
fd7c7e9b51
  1. 15
      ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.html
  2. 8
      ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.ts
  3. 18
      ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.html
  4. 8
      ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.ts
  5. 15
      ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html
  6. 9
      ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.ts
  7. 11
      ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.models.ts
  8. 15
      ui-ngx/src/app/modules/home/components/widget/lib/chart/echarts-widget.models.ts
  9. 11
      ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.models.ts
  10. 9
      ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.models.ts
  11. 15
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.html
  12. 6
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts
  13. 15
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.html
  14. 6
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.ts
  15. 15
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.html
  16. 7
      ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.ts
  17. 1
      ui-ngx/src/assets/locale/locale.constant-en_US.json

15
ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.html

@ -239,10 +239,24 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-template matExpansionPanelContent> <ng-template matExpansionPanelContent>
<div class="tb-form-row space-between">
<div>{{ 'tooltip.label' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipLabelFont"
[initialPreviewStyle]="{ color: barChartWidgetConfigForm.get('tooltipLabelColor').value }"
previewText="Temperature">
</tb-font-settings>
<tb-color-input asBoxInput
colorClearButton
formControlName="tooltipLabelColor">
</tb-color-input>
</div>
</div>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between">
<div>{{ 'tooltip.value' | translate }}</div> <div>{{ 'tooltip.value' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipValueFont" <tb-font-settings formControlName="tooltipValueFont"
[initialPreviewStyle]="{ color: barChartWidgetConfigForm.get('tooltipValueColor').value }"
[previewText]="tooltipValuePreviewFn"> [previewText]="tooltipValuePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput
@ -259,6 +273,7 @@
<tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto <tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto
formControlName="tooltipDateFormat"></tb-date-format-select> formControlName="tooltipDateFormat"></tb-date-format-select>
<tb-font-settings formControlName="tooltipDateFont" <tb-font-settings formControlName="tooltipDateFont"
[initialPreviewStyle]="{ color: barChartWidgetConfigForm.get('tooltipDateColor').value }"
[previewText]="tooltipDatePreviewFn"> [previewText]="tooltipDatePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput

8
ui-ngx/src/app/modules/home/components/widget/config/basic/chart/bar-chart-with-labels-basic-config.component.ts

@ -139,6 +139,8 @@ export class BarChartWithLabelsBasicConfigComponent extends BasicWidgetConfigCom
legendLabelColor: [settings.legendLabelColor, []], legendLabelColor: [settings.legendLabelColor, []],
showTooltip: [settings.showTooltip, []], showTooltip: [settings.showTooltip, []],
tooltipLabelFont: [settings.tooltipLabelFont, []],
tooltipLabelColor: [settings.tooltipLabelColor, []],
tooltipValueFont: [settings.tooltipValueFont, []], tooltipValueFont: [settings.tooltipValueFont, []],
tooltipValueColor: [settings.tooltipValueColor, []], tooltipValueColor: [settings.tooltipValueColor, []],
tooltipShowDate: [settings.tooltipShowDate, []], tooltipShowDate: [settings.tooltipShowDate, []],
@ -210,6 +212,8 @@ export class BarChartWithLabelsBasicConfigComponent extends BasicWidgetConfigCom
this.widgetConfig.config.settings.legendLabelColor = config.legendLabelColor; this.widgetConfig.config.settings.legendLabelColor = config.legendLabelColor;
this.widgetConfig.config.settings.showTooltip = config.showTooltip; this.widgetConfig.config.settings.showTooltip = config.showTooltip;
this.widgetConfig.config.settings.tooltipLabelFont = config.tooltipLabelFont;
this.widgetConfig.config.settings.tooltipLabelColor = config.tooltipLabelColor;
this.widgetConfig.config.settings.tooltipValueFont = config.tooltipValueFont; this.widgetConfig.config.settings.tooltipValueFont = config.tooltipValueFont;
this.widgetConfig.config.settings.tooltipValueColor = config.tooltipValueColor; this.widgetConfig.config.settings.tooltipValueColor = config.tooltipValueColor;
this.widgetConfig.config.settings.tooltipShowDate = config.tooltipShowDate; this.widgetConfig.config.settings.tooltipShowDate = config.tooltipShowDate;
@ -302,6 +306,8 @@ export class BarChartWithLabelsBasicConfigComponent extends BasicWidgetConfigCom
} }
if (showTooltip) { if (showTooltip) {
this.barChartWidgetConfigForm.get('tooltipLabelFont').enable();
this.barChartWidgetConfigForm.get('tooltipLabelColor').enable();
this.barChartWidgetConfigForm.get('tooltipValueFont').enable(); this.barChartWidgetConfigForm.get('tooltipValueFont').enable();
this.barChartWidgetConfigForm.get('tooltipValueColor').enable(); this.barChartWidgetConfigForm.get('tooltipValueColor').enable();
this.barChartWidgetConfigForm.get('tooltipShowDate').enable({emitEvent: false}); this.barChartWidgetConfigForm.get('tooltipShowDate').enable({emitEvent: false});
@ -319,6 +325,8 @@ export class BarChartWithLabelsBasicConfigComponent extends BasicWidgetConfigCom
this.barChartWidgetConfigForm.get('tooltipDateInterval').disable(); this.barChartWidgetConfigForm.get('tooltipDateInterval').disable();
} }
} else { } else {
this.barChartWidgetConfigForm.get('tooltipLabelFont').disable();
this.barChartWidgetConfigForm.get('tooltipLabelColor').disable();
this.barChartWidgetConfigForm.get('tooltipValueFont').disable(); this.barChartWidgetConfigForm.get('tooltipValueFont').disable();
this.barChartWidgetConfigForm.get('tooltipValueColor').disable(); this.barChartWidgetConfigForm.get('tooltipValueColor').disable();
this.barChartWidgetConfigForm.get('tooltipShowDate').disable({emitEvent: false}); this.barChartWidgetConfigForm.get('tooltipShowDate').disable({emitEvent: false});

18
ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.html

@ -301,10 +301,24 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-template matExpansionPanelContent> <ng-template matExpansionPanelContent>
<div class="tb-form-row space-between">
<div>{{ 'tooltip.label' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipLabelFont"
[initialPreviewStyle]="{ color: rangeChartWidgetConfigForm.get('tooltipLabelColor').value }"
previewText="Temperature">
</tb-font-settings>
<tb-color-input asBoxInput
colorClearButton
formControlName="tooltipLabelColor">
</tb-color-input>
</div>
</div>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between">
<div>{{ 'tooltip.value' | translate }}</div> <div>{{ 'tooltip.value' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipValueFont" <tb-font-settings formControlName="tooltipValueFont"
[initialPreviewStyle]="{ color: rangeChartWidgetConfigForm.get('tooltipValueColor').value }"
[previewText]="tooltipValuePreviewFn"> [previewText]="tooltipValuePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput
@ -312,8 +326,7 @@
formControlName="tooltipValueColor"> formControlName="tooltipValueColor">
</tb-color-input> </tb-color-input>
</div> </div>
</div> </div> <div class="tb-form-row column-xs">
<div class="tb-form-row column-xs">
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="tooltipShowDate"> <mat-slide-toggle class="mat-slide fixed-title-width" formControlName="tooltipShowDate">
{{ 'tooltip.date' | translate }} {{ 'tooltip.date' | translate }}
</mat-slide-toggle> </mat-slide-toggle>
@ -321,6 +334,7 @@
<tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto <tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto
formControlName="tooltipDateFormat"></tb-date-format-select> formControlName="tooltipDateFormat"></tb-date-format-select>
<tb-font-settings formControlName="tooltipDateFont" <tb-font-settings formControlName="tooltipDateFont"
[initialPreviewStyle]="{ color: rangeChartWidgetConfigForm.get('tooltipDateColor').value }"
[previewText]="tooltipDatePreviewFn"> [previewText]="tooltipDatePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput

8
ui-ngx/src/app/modules/home/components/widget/config/basic/chart/range-chart-basic-config.component.ts

@ -175,6 +175,8 @@ export class RangeChartBasicConfigComponent extends BasicWidgetConfigComponent {
legendLabelColor: [settings.legendLabelColor, []], legendLabelColor: [settings.legendLabelColor, []],
showTooltip: [settings.showTooltip, []], showTooltip: [settings.showTooltip, []],
tooltipLabelFont: [settings.tooltipLabelFont, []],
tooltipLabelColor: [settings.tooltipLabelColor, []],
tooltipValueFont: [settings.tooltipValueFont, []], tooltipValueFont: [settings.tooltipValueFont, []],
tooltipValueColor: [settings.tooltipValueColor, []], tooltipValueColor: [settings.tooltipValueColor, []],
tooltipShowDate: [settings.tooltipShowDate, []], tooltipShowDate: [settings.tooltipShowDate, []],
@ -257,6 +259,8 @@ export class RangeChartBasicConfigComponent extends BasicWidgetConfigComponent {
this.widgetConfig.config.settings.legendLabelColor = config.legendLabelColor; this.widgetConfig.config.settings.legendLabelColor = config.legendLabelColor;
this.widgetConfig.config.settings.showTooltip = config.showTooltip; this.widgetConfig.config.settings.showTooltip = config.showTooltip;
this.widgetConfig.config.settings.tooltipLabelFont = config.tooltipLabelFont;
this.widgetConfig.config.settings.tooltipLabelColor = config.tooltipLabelColor;
this.widgetConfig.config.settings.tooltipValueFont = config.tooltipValueFont; this.widgetConfig.config.settings.tooltipValueFont = config.tooltipValueFont;
this.widgetConfig.config.settings.tooltipValueColor = config.tooltipValueColor; this.widgetConfig.config.settings.tooltipValueColor = config.tooltipValueColor;
this.widgetConfig.config.settings.tooltipShowDate = config.tooltipShowDate; this.widgetConfig.config.settings.tooltipShowDate = config.tooltipShowDate;
@ -381,6 +385,8 @@ export class RangeChartBasicConfigComponent extends BasicWidgetConfigComponent {
} }
if (showTooltip) { if (showTooltip) {
this.rangeChartWidgetConfigForm.get('tooltipLabelFont').enable();
this.rangeChartWidgetConfigForm.get('tooltipLabelColor').enable();
this.rangeChartWidgetConfigForm.get('tooltipValueFont').enable(); this.rangeChartWidgetConfigForm.get('tooltipValueFont').enable();
this.rangeChartWidgetConfigForm.get('tooltipValueColor').enable(); this.rangeChartWidgetConfigForm.get('tooltipValueColor').enable();
this.rangeChartWidgetConfigForm.get('tooltipShowDate').enable({emitEvent: false}); this.rangeChartWidgetConfigForm.get('tooltipShowDate').enable({emitEvent: false});
@ -398,6 +404,8 @@ export class RangeChartBasicConfigComponent extends BasicWidgetConfigComponent {
this.rangeChartWidgetConfigForm.get('tooltipDateInterval').disable(); this.rangeChartWidgetConfigForm.get('tooltipDateInterval').disable();
} }
} else { } else {
this.rangeChartWidgetConfigForm.get('tooltipLabelFont').disable();
this.rangeChartWidgetConfigForm.get('tooltipLabelColor').disable();
this.rangeChartWidgetConfigForm.get('tooltipValueFont').disable(); this.rangeChartWidgetConfigForm.get('tooltipValueFont').disable();
this.rangeChartWidgetConfigForm.get('tooltipValueColor').disable(); this.rangeChartWidgetConfigForm.get('tooltipValueColor').disable();
this.rangeChartWidgetConfigForm.get('tooltipShowDate').disable({emitEvent: false}); this.rangeChartWidgetConfigForm.get('tooltipShowDate').disable({emitEvent: false});

15
ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.html

@ -261,10 +261,24 @@
[value]="EChartsTooltipTrigger.axis">{{ 'tooltip.trigger-axis' | translate }}</mat-chip-option> [value]="EChartsTooltipTrigger.axis">{{ 'tooltip.trigger-axis' | translate }}</mat-chip-option>
</mat-chip-listbox> </mat-chip-listbox>
</div> </div>
<div class="tb-form-row space-between">
<div>{{ 'tooltip.label' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipLabelFont"
[initialPreviewStyle]="{ color: timeSeriesChartWidgetConfigForm.get('tooltipLabelColor').value }"
previewText="Temperature">
</tb-font-settings>
<tb-color-input asBoxInput
colorClearButton
formControlName="tooltipLabelColor">
</tb-color-input>
</div>
</div>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between">
<div>{{ 'tooltip.value' | translate }}</div> <div>{{ 'tooltip.value' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipValueFont" <tb-font-settings formControlName="tooltipValueFont"
[initialPreviewStyle]="{ color: timeSeriesChartWidgetConfigForm.get('tooltipValueColor').value }"
[previewText]="tooltipValuePreviewFn"> [previewText]="tooltipValuePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput
@ -281,6 +295,7 @@
<tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto <tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto
formControlName="tooltipDateFormat"></tb-date-format-select> formControlName="tooltipDateFormat"></tb-date-format-select>
<tb-font-settings formControlName="tooltipDateFont" <tb-font-settings formControlName="tooltipDateFont"
[initialPreviewStyle]="{ color: timeSeriesChartWidgetConfigForm.get('tooltipDateColor').value }"
[previewText]="tooltipDatePreviewFn"> [previewText]="tooltipDatePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput

9
ui-ngx/src/app/modules/home/components/widget/config/basic/chart/time-series-chart-basic-config.component.ts

@ -178,6 +178,8 @@ export class TimeSeriesChartBasicConfigComponent extends BasicWidgetConfigCompon
showTooltip: [settings.showTooltip, []], showTooltip: [settings.showTooltip, []],
tooltipTrigger: [settings.tooltipTrigger, []], tooltipTrigger: [settings.tooltipTrigger, []],
tooltipLabelFont: [settings.tooltipLabelFont, []],
tooltipLabelColor: [settings.tooltipLabelColor, []],
tooltipValueFont: [settings.tooltipValueFont, []], tooltipValueFont: [settings.tooltipValueFont, []],
tooltipValueColor: [settings.tooltipValueColor, []], tooltipValueColor: [settings.tooltipValueColor, []],
tooltipShowDate: [settings.tooltipShowDate, []], tooltipShowDate: [settings.tooltipShowDate, []],
@ -250,6 +252,8 @@ export class TimeSeriesChartBasicConfigComponent extends BasicWidgetConfigCompon
this.widgetConfig.config.settings.showTooltip = config.showTooltip; this.widgetConfig.config.settings.showTooltip = config.showTooltip;
this.widgetConfig.config.settings.tooltipTrigger = config.tooltipTrigger; this.widgetConfig.config.settings.tooltipTrigger = config.tooltipTrigger;
this.widgetConfig.config.settings.tooltipLabelFont = config.tooltipLabelFont;
this.widgetConfig.config.settings.tooltipLabelColor = config.tooltipLabelColor;
this.widgetConfig.config.settings.tooltipValueFont = config.tooltipValueFont; this.widgetConfig.config.settings.tooltipValueFont = config.tooltipValueFont;
this.widgetConfig.config.settings.tooltipValueColor = config.tooltipValueColor; this.widgetConfig.config.settings.tooltipValueColor = config.tooltipValueColor;
this.widgetConfig.config.settings.tooltipShowDate = config.tooltipShowDate; this.widgetConfig.config.settings.tooltipShowDate = config.tooltipShowDate;
@ -345,6 +349,8 @@ export class TimeSeriesChartBasicConfigComponent extends BasicWidgetConfigCompon
if (showTooltip) { if (showTooltip) {
this.timeSeriesChartWidgetConfigForm.get('tooltipTrigger').enable(); this.timeSeriesChartWidgetConfigForm.get('tooltipTrigger').enable();
this.timeSeriesChartWidgetConfigForm.get('tooltipLabelFont').enable();
this.timeSeriesChartWidgetConfigForm.get('tooltipLabelColor').enable();
this.timeSeriesChartWidgetConfigForm.get('tooltipValueFont').enable(); this.timeSeriesChartWidgetConfigForm.get('tooltipValueFont').enable();
this.timeSeriesChartWidgetConfigForm.get('tooltipValueColor').enable(); this.timeSeriesChartWidgetConfigForm.get('tooltipValueColor').enable();
this.timeSeriesChartWidgetConfigForm.get('tooltipShowDate').enable({emitEvent: false}); this.timeSeriesChartWidgetConfigForm.get('tooltipShowDate').enable({emitEvent: false});
@ -362,6 +368,9 @@ export class TimeSeriesChartBasicConfigComponent extends BasicWidgetConfigCompon
this.timeSeriesChartWidgetConfigForm.get('tooltipDateInterval').disable(); this.timeSeriesChartWidgetConfigForm.get('tooltipDateInterval').disable();
} }
} else { } else {
this.timeSeriesChartWidgetConfigForm.get('tooltipTrigger').disable();
this.timeSeriesChartWidgetConfigForm.get('tooltipLabelFont').disable();
this.timeSeriesChartWidgetConfigForm.get('tooltipLabelColor').disable();
this.timeSeriesChartWidgetConfigForm.get('tooltipValueFont').disable(); this.timeSeriesChartWidgetConfigForm.get('tooltipValueFont').disable();
this.timeSeriesChartWidgetConfigForm.get('tooltipValueColor').disable(); this.timeSeriesChartWidgetConfigForm.get('tooltipValueColor').disable();
this.timeSeriesChartWidgetConfigForm.get('tooltipShowDate').disable({emitEvent: false}); this.timeSeriesChartWidgetConfigForm.get('tooltipShowDate').disable({emitEvent: false});

11
ui-ngx/src/app/modules/home/components/widget/lib/chart/bar-chart-with-labels-widget.models.ts

@ -131,6 +131,15 @@ export const barChartWithLabelsDefaultSettings: BarChartWithLabelsWidgetSettings
}, },
legendLabelColor: 'rgba(0, 0, 0, 0.76)', legendLabelColor: 'rgba(0, 0, 0, 0.76)',
showTooltip: true, showTooltip: true,
tooltipLabelFont: {
family: 'Roboto',
size: 12,
sizeUnit: 'px',
style: 'normal',
weight: '400',
lineHeight: '16px'
},
tooltipLabelColor: 'rgba(0, 0, 0, 0.76)',
tooltipValueFont: { tooltipValueFont: {
family: 'Roboto', family: 'Roboto',
size: 12, size: 12,
@ -181,6 +190,8 @@ export const barChartWithLabelsTimeSeriesSettings = (settings: BarChartWithLabel
animation: settings.animation, animation: settings.animation,
thresholds: settings.thresholds, thresholds: settings.thresholds,
showTooltip: settings.showTooltip, showTooltip: settings.showTooltip,
tooltipLabelFont: settings.tooltipLabelFont,
tooltipLabelColor: settings.tooltipLabelColor,
tooltipValueFont: settings.tooltipValueFont, tooltipValueFont: settings.tooltipValueFont,
tooltipValueColor: settings.tooltipValueColor, tooltipValueColor: settings.tooltipValueColor,
tooltipShowDate: settings.tooltipShowDate, tooltipShowDate: settings.tooltipShowDate,

15
ui-ngx/src/app/modules/home/components/widget/lib/chart/echarts-widget.models.ts

@ -447,6 +447,8 @@ export interface EChartsTooltipWidgetSettings {
showTooltip: boolean; showTooltip: boolean;
tooltipTrigger?: EChartsTooltipTrigger; tooltipTrigger?: EChartsTooltipTrigger;
tooltipShowFocusedSeries?: boolean; tooltipShowFocusedSeries?: boolean;
tooltipLabelFont: Font;
tooltipLabelColor: string;
tooltipValueFont: Font; tooltipValueFont: Font;
tooltipValueColor: string; tooltipValueColor: string;
tooltipValueFormatter?: string | EChartsTooltipValueFormatFunction; tooltipValueFormatter?: string | EChartsTooltipValueFormatFunction;
@ -631,13 +633,12 @@ const constructEchartsTooltipSeriesElement = (renderer: Renderer2,
renderer.appendChild(labelElement, circleElement); renderer.appendChild(labelElement, circleElement);
const labelTextElement: HTMLElement = renderer.createElement('div'); const labelTextElement: HTMLElement = renderer.createElement('div');
renderer.appendChild(labelTextElement, renderer.createText(item.param.seriesName)); renderer.appendChild(labelTextElement, renderer.createText(item.param.seriesName));
renderer.setStyle(labelTextElement, 'font-family', 'Roboto'); renderer.setStyle(labelTextElement, 'font-family', settings.tooltipLabelFont.family);
renderer.setStyle(labelTextElement, 'font-size', '12px'); renderer.setStyle(labelTextElement, 'font-size', settings.tooltipLabelFont.size + settings.tooltipLabelFont.sizeUnit);
renderer.setStyle(labelTextElement, 'font-style', 'normal'); renderer.setStyle(labelTextElement, 'font-style', settings.tooltipLabelFont.style);
renderer.setStyle(labelTextElement, 'font-weight', '400'); renderer.setStyle(labelTextElement, 'font-weight', settings.tooltipLabelFont.weight);
renderer.setStyle(labelTextElement, 'line-height', '16px'); renderer.setStyle(labelTextElement, 'line-height', settings.tooltipLabelFont.lineHeight);
renderer.setStyle(labelTextElement, 'letter-spacing', '0.4px'); renderer.setStyle(labelTextElement, 'color', settings.tooltipLabelColor);
renderer.setStyle(labelTextElement, 'color', 'rgba(0, 0, 0, 0.76)');
renderer.appendChild(labelElement, labelTextElement); renderer.appendChild(labelElement, labelTextElement);
const valueElement: HTMLElement = renderer.createElement('div'); const valueElement: HTMLElement = renderer.createElement('div');
let formatFunction = valueFormatFunction; let formatFunction = valueFormatFunction;

11
ui-ngx/src/app/modules/home/components/widget/lib/chart/range-chart-widget.models.ts

@ -165,6 +165,15 @@ export const rangeChartDefaultSettings: RangeChartWidgetSettings = {
}, },
legendLabelColor: 'rgba(0, 0, 0, 0.76)', legendLabelColor: 'rgba(0, 0, 0, 0.76)',
showTooltip: true, showTooltip: true,
tooltipLabelFont: {
family: 'Roboto',
size: 12,
sizeUnit: 'px',
style: 'normal',
weight: '400',
lineHeight: '16px'
},
tooltipLabelColor: 'rgba(0, 0, 0, 0.76)',
tooltipValueFont: { tooltipValueFont: {
family: 'Roboto', family: 'Roboto',
size: 12, size: 12,
@ -233,6 +242,8 @@ export const rangeChartTimeSeriesSettings = (settings: RangeChartWidgetSettings,
pieces: rangeItems.map(item => item.piece) pieces: rangeItems.map(item => item.piece)
}, },
showTooltip: settings.showTooltip, showTooltip: settings.showTooltip,
tooltipLabelFont: settings.tooltipLabelFont,
tooltipLabelColor: settings.tooltipLabelColor,
tooltipValueFont: settings.tooltipValueFont, tooltipValueFont: settings.tooltipValueFont,
tooltipValueColor: settings.tooltipValueColor, tooltipValueColor: settings.tooltipValueColor,
tooltipShowDate: settings.tooltipShowDate, tooltipShowDate: settings.tooltipShowDate,

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

@ -752,6 +752,15 @@ export const timeSeriesChartDefaultSettings: TimeSeriesChartSettings = {
timeSeriesChartNoAggregationBarWidthDefaultSettings), timeSeriesChartNoAggregationBarWidthDefaultSettings),
showTooltip: true, showTooltip: true,
tooltipTrigger: EChartsTooltipTrigger.axis, tooltipTrigger: EChartsTooltipTrigger.axis,
tooltipLabelFont: {
family: 'Roboto',
size: 12,
sizeUnit: 'px',
style: 'normal',
weight: '400',
lineHeight: '16px'
},
tooltipLabelColor: 'rgba(0, 0, 0, 0.76)',
tooltipValueFont: { tooltipValueFont: {
family: 'Roboto', family: 'Roboto',
size: 12, size: 12,

15
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.html

@ -160,10 +160,24 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-template matExpansionPanelContent> <ng-template matExpansionPanelContent>
<div class="tb-form-row space-between">
<div>{{ 'tooltip.label' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipLabelFont"
[initialPreviewStyle]="{ color: barChartWidgetSettingsForm.get('tooltipLabelColor').value }"
previewText="Temperature">
</tb-font-settings>
<tb-color-input asBoxInput
colorClearButton
formControlName="tooltipLabelColor">
</tb-color-input>
</div>
</div>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between">
<div>{{ 'tooltip.value' | translate }}</div> <div>{{ 'tooltip.value' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipValueFont" <tb-font-settings formControlName="tooltipValueFont"
[initialPreviewStyle]="{ color: barChartWidgetSettingsForm.get('tooltipValueColor').value }"
[previewText]="tooltipValuePreviewFn"> [previewText]="tooltipValuePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput
@ -180,6 +194,7 @@
<tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto <tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto
formControlName="tooltipDateFormat"></tb-date-format-select> formControlName="tooltipDateFormat"></tb-date-format-select>
<tb-font-settings formControlName="tooltipDateFont" <tb-font-settings formControlName="tooltipDateFont"
[initialPreviewStyle]="{ color: barChartWidgetSettingsForm.get('tooltipDateColor').value }"
[previewText]="tooltipDatePreviewFn"> [previewText]="tooltipDatePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput

6
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/bar-chart-with-labels-widget-settings.component.ts

@ -103,6 +103,8 @@ export class BarChartWithLabelsWidgetSettingsComponent extends WidgetSettingsCom
legendLabelColor: [settings.legendLabelColor, []], legendLabelColor: [settings.legendLabelColor, []],
showTooltip: [settings.showTooltip, []], showTooltip: [settings.showTooltip, []],
tooltipLabelFont: [settings.tooltipLabelFont, []],
tooltipLabelColor: [settings.tooltipLabelColor, []],
tooltipValueFont: [settings.tooltipValueFont, []], tooltipValueFont: [settings.tooltipValueFont, []],
tooltipValueColor: [settings.tooltipValueColor, []], tooltipValueColor: [settings.tooltipValueColor, []],
tooltipShowDate: [settings.tooltipShowDate, []], tooltipShowDate: [settings.tooltipShowDate, []],
@ -164,6 +166,8 @@ export class BarChartWithLabelsWidgetSettingsComponent extends WidgetSettingsCom
} }
if (showTooltip) { if (showTooltip) {
this.barChartWidgetSettingsForm.get('tooltipLabelFont').enable();
this.barChartWidgetSettingsForm.get('tooltipLabelColor').enable();
this.barChartWidgetSettingsForm.get('tooltipValueFont').enable(); this.barChartWidgetSettingsForm.get('tooltipValueFont').enable();
this.barChartWidgetSettingsForm.get('tooltipValueColor').enable(); this.barChartWidgetSettingsForm.get('tooltipValueColor').enable();
this.barChartWidgetSettingsForm.get('tooltipShowDate').enable({emitEvent: false}); this.barChartWidgetSettingsForm.get('tooltipShowDate').enable({emitEvent: false});
@ -181,6 +185,8 @@ export class BarChartWithLabelsWidgetSettingsComponent extends WidgetSettingsCom
this.barChartWidgetSettingsForm.get('tooltipDateInterval').disable(); this.barChartWidgetSettingsForm.get('tooltipDateInterval').disable();
} }
} else { } else {
this.barChartWidgetSettingsForm.get('tooltipLabelFont').disable();
this.barChartWidgetSettingsForm.get('tooltipLabelColor').disable();
this.barChartWidgetSettingsForm.get('tooltipValueFont').disable(); this.barChartWidgetSettingsForm.get('tooltipValueFont').disable();
this.barChartWidgetSettingsForm.get('tooltipValueColor').disable(); this.barChartWidgetSettingsForm.get('tooltipValueColor').disable();
this.barChartWidgetSettingsForm.get('tooltipShowDate').disable({emitEvent: false}); this.barChartWidgetSettingsForm.get('tooltipShowDate').disable({emitEvent: false});

15
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.html

@ -236,10 +236,24 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-template matExpansionPanelContent> <ng-template matExpansionPanelContent>
<div class="tb-form-row space-between">
<div>{{ 'tooltip.label' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipLabelFont"
[initialPreviewStyle]="{ color: rangeChartWidgetSettingsForm.get('tooltipLabelColor').value }"
previewText="Temperature">
</tb-font-settings>
<tb-color-input asBoxInput
colorClearButton
formControlName="tooltipLabelColor">
</tb-color-input>
</div>
</div>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between">
<div>{{ 'tooltip.value' | translate }}</div> <div>{{ 'tooltip.value' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipValueFont" <tb-font-settings formControlName="tooltipValueFont"
[initialPreviewStyle]="{ color: rangeChartWidgetSettingsForm.get('tooltipValueColor').value }"
[previewText]="tooltipValuePreviewFn"> [previewText]="tooltipValuePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput
@ -256,6 +270,7 @@
<tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto <tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto
formControlName="tooltipDateFormat"></tb-date-format-select> formControlName="tooltipDateFormat"></tb-date-format-select>
<tb-font-settings formControlName="tooltipDateFont" <tb-font-settings formControlName="tooltipDateFont"
[initialPreviewStyle]="{ color: rangeChartWidgetSettingsForm.get('tooltipDateColor').value }"
[previewText]="tooltipDatePreviewFn"> [previewText]="tooltipDatePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput

6
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/range-chart-widget-settings.component.ts

@ -141,6 +141,8 @@ export class RangeChartWidgetSettingsComponent extends WidgetSettingsComponent {
legendLabelColor: [settings.legendLabelColor, []], legendLabelColor: [settings.legendLabelColor, []],
showTooltip: [settings.showTooltip, []], showTooltip: [settings.showTooltip, []],
tooltipLabelFont: [settings.tooltipLabelFont, []],
tooltipLabelColor: [settings.tooltipLabelColor, []],
tooltipValueFont: [settings.tooltipValueFont, []], tooltipValueFont: [settings.tooltipValueFont, []],
tooltipValueColor: [settings.tooltipValueColor, []], tooltipValueColor: [settings.tooltipValueColor, []],
tooltipShowDate: [settings.tooltipShowDate, []], tooltipShowDate: [settings.tooltipShowDate, []],
@ -232,6 +234,8 @@ export class RangeChartWidgetSettingsComponent extends WidgetSettingsComponent {
} }
if (showTooltip) { if (showTooltip) {
this.rangeChartWidgetSettingsForm.get('tooltipLabelFont').enable();
this.rangeChartWidgetSettingsForm.get('tooltipLabelColor').enable();
this.rangeChartWidgetSettingsForm.get('tooltipValueFont').enable(); this.rangeChartWidgetSettingsForm.get('tooltipValueFont').enable();
this.rangeChartWidgetSettingsForm.get('tooltipValueColor').enable(); this.rangeChartWidgetSettingsForm.get('tooltipValueColor').enable();
this.rangeChartWidgetSettingsForm.get('tooltipShowDate').enable({emitEvent: false}); this.rangeChartWidgetSettingsForm.get('tooltipShowDate').enable({emitEvent: false});
@ -249,6 +253,8 @@ export class RangeChartWidgetSettingsComponent extends WidgetSettingsComponent {
this.rangeChartWidgetSettingsForm.get('tooltipDateInterval').disable(); this.rangeChartWidgetSettingsForm.get('tooltipDateInterval').disable();
} }
} else { } else {
this.rangeChartWidgetSettingsForm.get('tooltipLabelFont').disable();
this.rangeChartWidgetSettingsForm.get('tooltipLabelColor').disable();
this.rangeChartWidgetSettingsForm.get('tooltipValueFont').disable(); this.rangeChartWidgetSettingsForm.get('tooltipValueFont').disable();
this.rangeChartWidgetSettingsForm.get('tooltipValueColor').disable(); this.rangeChartWidgetSettingsForm.get('tooltipValueColor').disable();
this.rangeChartWidgetSettingsForm.get('tooltipShowDate').disable({emitEvent: false}); this.rangeChartWidgetSettingsForm.get('tooltipShowDate').disable({emitEvent: false});

15
ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/time-series-chart-widget-settings.component.html

@ -180,10 +180,24 @@
[value]="EChartsTooltipTrigger.axis">{{ 'tooltip.trigger-axis' | translate }}</mat-chip-option> [value]="EChartsTooltipTrigger.axis">{{ 'tooltip.trigger-axis' | translate }}</mat-chip-option>
</mat-chip-listbox> </mat-chip-listbox>
</div> </div>
<div class="tb-form-row space-between">
<div>{{ 'tooltip.label' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipLabelFont"
[initialPreviewStyle]="{ color: timeSeriesChartWidgetSettingsForm.get('tooltipLabelColor').value }"
previewText="Temperature">
</tb-font-settings>
<tb-color-input asBoxInput
colorClearButton
formControlName="tooltipLabelColor">
</tb-color-input>
</div>
</div>
<div class="tb-form-row space-between"> <div class="tb-form-row space-between">
<div>{{ 'tooltip.value' | translate }}</div> <div>{{ 'tooltip.value' | translate }}</div>
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<tb-font-settings formControlName="tooltipValueFont" <tb-font-settings formControlName="tooltipValueFont"
[initialPreviewStyle]="{ color: timeSeriesChartWidgetSettingsForm.get('tooltipValueColor').value }"
[previewText]="tooltipValuePreviewFn"> [previewText]="tooltipValuePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput
@ -207,6 +221,7 @@
<tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto <tb-date-format-select fxFlex excludeLastUpdateAgo includeAuto
formControlName="tooltipDateFormat"></tb-date-format-select> formControlName="tooltipDateFormat"></tb-date-format-select>
<tb-font-settings formControlName="tooltipDateFont" <tb-font-settings formControlName="tooltipDateFont"
[initialPreviewStyle]="{ color: timeSeriesChartWidgetSettingsForm.get('tooltipDateColor').value }"
[previewText]="tooltipDatePreviewFn"> [previewText]="tooltipDatePreviewFn">
</tb-font-settings> </tb-font-settings>
<tb-color-input asBoxInput <tb-color-input asBoxInput

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

@ -143,6 +143,8 @@ export class TimeSeriesChartWidgetSettingsComponent extends WidgetSettingsCompon
showTooltip: [settings.showTooltip, []], showTooltip: [settings.showTooltip, []],
tooltipTrigger: [settings.tooltipTrigger, []], tooltipTrigger: [settings.tooltipTrigger, []],
tooltipLabelFont: [settings.tooltipLabelFont, []],
tooltipLabelColor: [settings.tooltipLabelColor, []],
tooltipValueFont: [settings.tooltipValueFont, []], tooltipValueFont: [settings.tooltipValueFont, []],
tooltipValueColor: [settings.tooltipValueColor, []], tooltipValueColor: [settings.tooltipValueColor, []],
tooltipValueFormatter: [settings.tooltipValueFormatter, []], tooltipValueFormatter: [settings.tooltipValueFormatter, []],
@ -205,6 +207,8 @@ export class TimeSeriesChartWidgetSettingsComponent extends WidgetSettingsCompon
if (showTooltip) { if (showTooltip) {
this.timeSeriesChartWidgetSettingsForm.get('tooltipTrigger').enable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipTrigger').enable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipLabelFont').enable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipLabelColor').enable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFont').enable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFont').enable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipValueColor').enable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipValueColor').enable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFormatter').enable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFormatter').enable();
@ -223,6 +227,9 @@ export class TimeSeriesChartWidgetSettingsComponent extends WidgetSettingsCompon
this.timeSeriesChartWidgetSettingsForm.get('tooltipDateInterval').disable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipDateInterval').disable();
} }
} else { } else {
this.timeSeriesChartWidgetSettingsForm.get('tooltipTrigger').disable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipLabelFont').disable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipLabelColor').disable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFont').disable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFont').disable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipValueColor').disable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipValueColor').disable();
this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFormatter').disable(); this.timeSeriesChartWidgetSettingsForm.get('tooltipValueFormatter').disable();

1
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -4453,6 +4453,7 @@
"trigger": "Trigger", "trigger": "Trigger",
"trigger-point": "Point", "trigger-point": "Point",
"trigger-axis": "Axis", "trigger-axis": "Axis",
"label": "Label",
"value": "Value", "value": "Value",
"date": "Date", "date": "Date",
"show-date-time-interval": "Show date time interval", "show-date-time-interval": "Show date time interval",

Loading…
Cancel
Save