mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: React Graph & Show message on no data (#16278)
This commit is contained in:
parent
9fd824960f
commit
236074ea47
@ -14,6 +14,7 @@ export class GraphPanel extends PureComponent<Props> {
|
||||
const { showLines, showBars, showPoints } = this.props.options;
|
||||
|
||||
const graphs: GraphSeriesXY[] = [];
|
||||
if (data) {
|
||||
for (const series of data) {
|
||||
const timeColumn = getFirstTimeField(series);
|
||||
if (timeColumn < 0) {
|
||||
@ -43,6 +44,15 @@ export class GraphPanel extends PureComponent<Props> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (graphs.length < 1) {
|
||||
return (
|
||||
<div className="panel-empty">
|
||||
<p>No data found in response</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Graph
|
||||
|
Loading…
Reference in New Issue
Block a user