making plot series name with unit a dynamic function

This commit is contained in:
Jamie Vigliotta 2020-07-30 15:38:32 -07:00
parent 3f2ad2be0c
commit 756e7e5372
2 changed files with 5 additions and 2 deletions

View File

@ -49,7 +49,7 @@
ng-style="{ 'background-color': series.get('color').asHexString() }">
</span>
<span class="is-missing__indicator" title="This item is missing"></span>
<span class="plot-series-name">{{ series.get('nameWithUnit') }}</span>
<span class="plot-series-name">{{ series.nameWithUnit() }}</span>
</div>
<div class="plot-series-value hover-value-enabled value-to-display-{{ legend.get('valueToShowWhenCollapsed') }} {{ series.closest.mctLimitState.cssClass }}"
ng-class="{ 'cursor-hover': (legend.get('valueToShowWhenCollapsed').indexOf('nearest') != -1) }"

View File

@ -102,7 +102,6 @@ define([
return {
name: options.domainObject.name,
unit: range.unit,
nameWithUnit: options.domainObject.name + (range.unit ? ' ' + range.unit : ''),
xKey: options.collection.plot.xAxis.get('key'),
yKey: range.key,
markers: true,
@ -428,6 +427,10 @@ define([
const markerSize = this.get('markerSize');
return `${markerShape}: ${markerSize}px`;
},
nameWithUnit: function () {
let unit = this.get('unit');
return this.get('name') + (unit ? ' ' + unit : '');
}
});