mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add the ability to set microseconds to the Y-Axis on graphs.
This commit is contained in:
parent
78f4a83d05
commit
218d481209
@ -517,5 +517,16 @@ function($, _, moment) {
|
||||
}
|
||||
};
|
||||
|
||||
kbn.microsFormat = function(size) {
|
||||
if (size < 1000) {
|
||||
return size.toFixed(0) + " µs";
|
||||
}
|
||||
else if (size < 1000000) {
|
||||
return (size / 1000).toFixed(1) + " ms";
|
||||
}
|
||||
else {
|
||||
return (size / 1000000).toFixed(1) + " s";
|
||||
};
|
||||
|
||||
return kbn;
|
||||
});
|
@ -300,6 +300,9 @@ function (angular, $, kbn, moment, _) {
|
||||
if (format === 'ms') {
|
||||
axis.tickFormatter = kbn.msFormat;
|
||||
}
|
||||
if (format === 'µs') {
|
||||
axis.tickFormatter = kbm.microsFormat;
|
||||
}
|
||||
}
|
||||
|
||||
function time_format(interval, ticks, min, max) {
|
||||
|
@ -10,11 +10,11 @@
|
||||
</div>
|
||||
<div class="editor-option">
|
||||
<label class="small">Left Y Format <tip>Y-axis formatting</tip></label>
|
||||
<select class="input-small" ng-model="panel.y_formats[0]" ng-options="f for f in ['none','short','bytes', 'ms']" ng-change="render()"></select>
|
||||
<select class="input-small" ng-model="panel.y_formats[0]" ng-options="f for f in ['none','short','bytes', 'ms', 'µs']" ng-change="render()"></select>
|
||||
</div>
|
||||
<div class="editor-option">
|
||||
<label class="small">Right Y Format <tip>Y-axis formatting</tip></label>
|
||||
<select class="input-small" ng-model="panel.y_formats[1]" ng-options="f for f in ['none','short','bytes', 'ms']" ng-change="render()"></select>
|
||||
<select class="input-small" ng-model="panel.y_formats[1]" ng-options="f for f in ['none','short','bytes', 'ms', 'µs']" ng-change="render()"></select>
|
||||
</div>
|
||||
|
||||
<div class="editor-option">
|
||||
|
Loading…
Reference in New Issue
Block a user