本文整理匯總了TypeScript中@grafana/ui.getValueFormats函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getValueFormats函數的具體用法?TypeScript getValueFormats怎麽用?TypeScript getValueFormats使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了getValueFormats函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
/** @ngInject */
constructor($scope) {
$scope.editor = this;
this.activeStyleIndex = 0;
this.panelCtrl = $scope.ctrl;
this.panel = this.panelCtrl.panel;
this.unitFormats = getValueFormats();
this.colorModes = [
{ text: 'Disabled', value: null },
{ text: 'Cell', value: 'cell' },
{ text: 'Value', value: 'value' },
{ text: 'Row', value: 'row' },
];
this.columnTypes = [
{ text: 'Number', value: 'number' },
{ text: 'String', value: 'string' },
{ text: 'Date', value: 'date' },
{ text: 'Hidden', value: 'hidden' },
];
this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];
this.dateFormats = [
{ text: 'YYYY-MM-DD HH:mm:ss', value: 'YYYY-MM-DD HH:mm:ss' },
{ text: 'YYYY-MM-DD HH:mm:ss.SSS', value: 'YYYY-MM-DD HH:mm:ss.SSS' },
{ text: 'MM/DD/YY h:mm:ss a', value: 'MM/DD/YY h:mm:ss a' },
{ text: 'MMMM D, YYYY LT', value: 'MMMM D, YYYY LT' },
{ text: 'YYYY-MM-DD', value: 'YYYY-MM-DD' },
];
this.mappingTypes = [{ text: 'Value to text', value: 1 }, { text: 'Range to text', value: 2 }];
this.getColumnNames = () => {
if (!this.panelCtrl.table) {
return [];
}
return _.map(this.panelCtrl.table.columns, (col: any) => {
return col.text;
});
};
this.onColorChange = this.onColorChange.bind(this);
}
示例2: constructor
/** @ngInject */
constructor(private $scope, private $q) {
this.panelCtrl = $scope.ctrl;
this.panel = this.panelCtrl.panel;
this.$scope.ctrl = this;
this.unitFormats = getValueFormats();
this.logScales = {
linear: 1,
'log (base 2)': 2,
'log (base 10)': 10,
'log (base 32)': 32,
'log (base 1024)': 1024,
};
this.xAxisModes = {
Time: 'time',
Series: 'series',
Histogram: 'histogram',
// 'Data field': 'field',
};
this.xAxisStatOptions = [
{ text: 'Avg', value: 'avg' },
{ text: 'Min', value: 'min' },
{ text: 'Max', value: 'max' },
{ text: 'Total', value: 'total' },
{ text: 'Count', value: 'count' },
{ text: 'Current', value: 'current' },
];
if (this.panel.xaxis.mode === 'custom') {
if (!this.panel.xaxis.name) {
this.panel.xaxis.name = 'specify field';
}
}
}
示例3: getValueFormats
kbn.getUnitFormats = () => {
return getValueFormats();
};