mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Fix showing of results of queries in table (#24018)
* Fix: Show results of instant queries in Explore tables * Add PreferredVisualisationType to meta * Implement visualisation exception for Prometheus * Implement visualisation exception for Elastic
This commit is contained in:
@@ -452,7 +452,11 @@ export class ElasticResponse {
|
||||
this.nameSeries(tmpSeriesList, target);
|
||||
|
||||
for (let y = 0; y < tmpSeriesList.length; y++) {
|
||||
const series = toDataFrame(tmpSeriesList[y]);
|
||||
let series = toDataFrame(tmpSeriesList[y]);
|
||||
|
||||
// When log results, show aggregations only in graph. Log fields are then going to be shown in table.
|
||||
series = addPreferredVisualisationType(series, 'graph');
|
||||
|
||||
dataFrame.push(series);
|
||||
}
|
||||
}
|
||||
@@ -568,3 +572,14 @@ const createEmptyDataFrame = (
|
||||
|
||||
return series;
|
||||
};
|
||||
|
||||
const addPreferredVisualisationType = (series: any, type: string) => {
|
||||
let s = series;
|
||||
s.meta
|
||||
? (s.meta.preferredVisualisationType = type)
|
||||
: (s.meta = {
|
||||
preferredVisualisationType: type,
|
||||
});
|
||||
|
||||
return s;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user