Skip to content

Commit

Permalink
Fixed prefix in case of negative percentage trend
Browse files Browse the repository at this point in the history
  • Loading branch information
nikos committed Nov 6, 2022
1 parent 220fff1 commit 14e031b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## 1.0.0 (2022-09-29)

Initial release.
* Initial release

## 1.0.1 (2022-09-30)

Added logo.
* Added logo

## 1.0.2 (2022-10-04)

* Avoid usage of deprecated UI theme and style setup.
* Fixed bug when using pixel to specify percentage value size.
* Avoid usage of deprecated UI theme and style setup
* Fixed bug when using pixel to specify percentage value size

## 1.0.3 (2022-10-05)

Expand All @@ -32,4 +32,8 @@ Added logo.
* Support locale unit for percentage value (thanks [@itsnull12](https://github.com/nikos/grafana-percent-trend-panel/issues/15))
* Allow to specify number of decimals displayed for percentage value
* Improved display in case no previous ("base") value available instead of infinity
* Improved display of stagnation (= 0% difference to base value)
* Improved display of stagnation (= 0% difference to base value)

## 1.0.7 (2022-11-06)

* Fixed prefix in case of negative percentage trend
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grafana-percent-trend-panel",
"version": "1.0.6",
"version": "1.0.7",
"description": "Grafana percent trend panel",
"scripts": {
"build": "grafana-toolkit plugin:build",
Expand Down
2 changes: 1 addition & 1 deletion src/PercentPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function prepareTrendDisplay(
: colors.getColorByName('green');

const suffix = options.interpretAsTrend ? (stagnation ? ' \u25B6' : percent > 0 ? ' \u25B2' : ' \u25BC') : '';
const prefix = !stagnation && baseValueSum > 0 ? '+' : '';
const prefix = !stagnation && percent > 0 ? '+' : '';

return {
percent,
Expand Down
4 changes: 2 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"path": "img/screenshots/panel-options.png"
}
],
"version": "1.0.6",
"updated": "2022-10-25"
"version": "1.0.7",
"updated": "2022-11-06"
},
"dependencies": {
"grafanaDependency": ">=8.1.0",
Expand Down

0 comments on commit 14e031b

Please sign in to comment.