Skip to content

Commit

Permalink
Add option to control whether to format target value. (#4063)
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr authored Aug 12, 2019
1 parent 7c2acc3 commit 7dd62ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions client/app/visualizations/counter/counter-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,13 @@
<input type="text" ng-model="$ctrl.options.stringSuffix" class="form-control" ng-disabled="!$ctrl.isValueNumber()" ng-trim="false">
</div>
</div>
<div class="form-group">
<div class="col-lg-6">
<label>
<input type="checkbox" ng-model="$ctrl.options.formatTargetValue">
Format Target Value
</label>
</div>
</div>
</div>
</div>
4 changes: 3 additions & 1 deletion client/app/visualizations/counter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ const CounterRenderer = {
$scope.targetValueTooltip = formatTooltip($scope.targetValue, options.tooltipFormat);

$scope.counterValue = formatValue($scope.counterValue, options);
$scope.targetValue = formatValue($scope.targetValue, options);
if (options.formatTargetValue) {
$scope.targetValue = formatValue($scope.targetValue, options);
}
}

$timeout(() => {
Expand Down

0 comments on commit 7dd62ef

Please sign in to comment.