2017-03-24 13:35:19 +03:00
|
|
|
///<reference path="../../../headers/common.d.ts" />
|
|
|
|
|
|
|
|
|
|
import kbn from 'app/core/utils/kbn';
|
|
|
|
|
|
|
|
|
|
export class AxesEditorCtrl {
|
|
|
|
|
panel: any;
|
|
|
|
|
panelCtrl: any;
|
|
|
|
|
unitFormats: any;
|
|
|
|
|
logScales: any;
|
2017-03-30 21:36:36 +03:00
|
|
|
dataFormats: any;
|
2017-03-24 13:35:19 +03:00
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
|
|
|
constructor($scope) {
|
|
|
|
|
$scope.editor = this;
|
|
|
|
|
this.panelCtrl = $scope.ctrl;
|
|
|
|
|
this.panel = this.panelCtrl.panel;
|
|
|
|
|
|
|
|
|
|
this.unitFormats = kbn.getUnitFormats();
|
|
|
|
|
|
|
|
|
|
this.logScales = {
|
|
|
|
|
'linear': 1,
|
|
|
|
|
'log (base 2)': 2,
|
|
|
|
|
'log (base 10)': 10,
|
|
|
|
|
'log (base 32)': 32,
|
|
|
|
|
'log (base 1024)': 1024
|
|
|
|
|
};
|
2017-03-30 21:36:36 +03:00
|
|
|
|
|
|
|
|
this.dataFormats = {
|
2017-04-26 14:18:52 +02:00
|
|
|
'Time series': 'timeseries',
|
|
|
|
|
'Time series Pre-bucketed': 'tsbuckets'
|
2017-03-30 21:36:36 +03:00
|
|
|
};
|
2017-03-24 13:35:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setUnitFormat(subItem) {
|
|
|
|
|
this.panel.yAxis.format = subItem.value;
|
|
|
|
|
this.panelCtrl.render();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
|
|
|
export function axesEditor() {
|
|
|
|
|
'use strict';
|
|
|
|
|
return {
|
|
|
|
|
restrict: 'E',
|
|
|
|
|
scope: true,
|
|
|
|
|
templateUrl: 'public/app/plugins/panel/heatmap/partials/axes_editor.html',
|
|
|
|
|
controller: AxesEditorCtrl,
|
|
|
|
|
};
|
|
|
|
|
}
|