[增添]增添了Metric的inline chart显示
This commit is contained in:
@@ -14,10 +14,11 @@ class MetricWidgetChart extends InlineChartWidget
|
|||||||
protected static ?string $maxHeight = '65px';
|
protected static ?string $maxHeight = '65px';
|
||||||
|
|
||||||
// public int $maxWidth = 1000;
|
// public int $maxWidth = 1000;
|
||||||
|
|
||||||
|
|
||||||
protected function getData(): array
|
protected function getData(): array
|
||||||
{
|
{
|
||||||
$prometheus = new PrometheusService();
|
$prometheus = new PrometheusService();
|
||||||
date_default_timezone_set('Asia/Shanghai');
|
|
||||||
|
|
||||||
$query1 = $this->record->name . '{data="real"}';
|
$query1 = $this->record->name . '{data="real"}';
|
||||||
|
|
||||||
@@ -52,6 +53,10 @@ class MetricWidgetChart extends InlineChartWidget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 将数据格式化为 InlineChartWidget 所需的格式
|
||||||
|
// $formattedRealData = $this->formatData($realdata, 'Real Data');
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'labels' => $labels,
|
'labels' => $labels,
|
||||||
'datasets' => [
|
'datasets' => [
|
||||||
|
|||||||
Reference in New Issue
Block a user