本文整理汇总了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();
};