mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 23:36:41 +00:00
[Plot] Use reverse filter for plot ticks
...to remove CSS-related reversal from scripts
This commit is contained in:
parent
96dc055f02
commit
a94e99af70
@ -153,7 +153,7 @@
|
||||
class="gl-plot-tick gl-plot-x-tick-label"
|
||||
ng-show="$index > 0 && $index < (subplot.getDomainTicks().length - 1)"
|
||||
ng-style="{ left: (100 * $index / (subplot.getDomainTicks().length - 1)) + '%' }">
|
||||
{{tick.label}}
|
||||
{{tick.label | reverse}}
|
||||
</div>
|
||||
|
||||
<div class="gl-plot-label gl-plot-x-label">
|
||||
|
@ -57,19 +57,12 @@ define(
|
||||
PlotTickGenerator.prototype.generateTicks = function (start, span, count, format) {
|
||||
var step = span / (count - 1),
|
||||
result = [],
|
||||
tickVal = '',
|
||||
i;
|
||||
|
||||
for (i = 0; i < count; i += 1) {
|
||||
tickVal = format(i * step + start);
|
||||
if (tickVal !== undefined) {
|
||||
// Make the tick value have its ellipsis on the least significant left side by reversing it here,
|
||||
// and then reversing it again via CSS.
|
||||
tickVal = tickVal.toString().split('').reverse().join('');
|
||||
}
|
||||
result.push({
|
||||
//If data to show, display label for each tick line, otherwise show lines but suppress labels.
|
||||
label: span > 0 ? tickVal : ''
|
||||
label: span > 0 ? format(i * step + start) : ''
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user