|
|
@ -266,7 +266,6 @@ export class TbCanvasDigitalGauge { |
|
|
|
|
|
|
|
|
init() { |
|
|
init() { |
|
|
let updateSetting = false; |
|
|
let updateSetting = false; |
|
|
|
|
|
|
|
|
if (this.localSettings.useFixedLevelColor && this.localSettings.fixedLevelColors?.length > 0) { |
|
|
if (this.localSettings.useFixedLevelColor && this.localSettings.fixedLevelColors?.length > 0) { |
|
|
this.localSettings.levelColors = this.settingLevelColorsSubscribe(this.localSettings.fixedLevelColors); |
|
|
this.localSettings.levelColors = this.settingLevelColorsSubscribe(this.localSettings.fixedLevelColors); |
|
|
updateSetting = true; |
|
|
updateSetting = true; |
|
|
@ -285,6 +284,11 @@ export class TbCanvasDigitalGauge { |
|
|
let levelColorsDatasource: Datasource[] = []; |
|
|
let levelColorsDatasource: Datasource[] = []; |
|
|
const predefineLevelColors: ColorLevelSetting[] = []; |
|
|
const predefineLevelColors: ColorLevelSetting[] = []; |
|
|
|
|
|
|
|
|
|
|
|
predefineLevelColors.push({ |
|
|
|
|
|
value: -Infinity, |
|
|
|
|
|
color: this.ctx.data[0].dataKey.color |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
function setLevelColor(levelSetting: AttributeSourceProperty, color: string) { |
|
|
function setLevelColor(levelSetting: AttributeSourceProperty, color: string) { |
|
|
if (levelSetting.valueSource === 'predefinedValue' && isFinite(levelSetting.value)) { |
|
|
if (levelSetting.valueSource === 'predefinedValue' && isFinite(levelSetting.value)) { |
|
|
predefineLevelColors.push({ |
|
|
predefineLevelColors.push({ |
|
|
|