Skip to content

Commit

Permalink
Replace double percent sign in chart unit, fixes openhab#870, fixes o…
Browse files Browse the repository at this point in the history
…penhab#928

Signed-off-by: Hubert Nusser <[email protected]>
  • Loading branch information
hubsif committed Mar 25, 2021
1 parent b7bec07 commit eeafb50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bundles/org.openhab.ui/web/src/pages/analyzer/analyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,14 @@ export default {
// dynamically add value axes according to unit if determined
const seriesOptions = this.seriesOptions[item.name]
if (!seriesOptions.discrete && (seriesOptions.type === 'line' || seriesOptions.type === 'bar')) {
const unit = (item.transformedState && item.transformedState.split(' ').length === 2)
let unit = (item.transformedState && item.transformedState.split(' ').length === 2)
? item.transformedState.split(' ')[1]
: (item.state.split(' ').length === 2)
? item.state.split(' ')[1]
: (item.stateDescription && item.stateDescription.pattern && item.stateDescription.pattern.split(' ').length === 2)
? item.stateDescription.pattern.split(' ')[1]
: undefined
if (unit) unit = unit.replace(/^%%/, '%')
let unitAxis = this.valueAxesOptions.findIndex((a) => a.unit === unit)
if (unitAxis >= 0) {
this.$set(seriesOptions, 'valueAxisIndex', unitAxis)
Expand Down

0 comments on commit eeafb50

Please sign in to comment.