Skip to content

Commit caff914

Browse files
authored
Tooltip: Fix issue with tooltip throwing an error when retrieving values (grafana#20565)
1 parent 83fa91b commit caff914

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/grafana-ui/src/components/Graph/Graph.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
139139

140140
// Check if tooltip needs to be rendered with custom tooltip component, otherwise default to GraphTooltip
141141
const tooltipContentRenderer = tooltipElementProps.tooltipComponent || GraphTooltip;
142-
143142
// Indicates column(field) index in y-axis dimension
144143
const seriesIndex = activeItem ? activeItem.series.seriesIndex : 0;
145144
// Indicates row index in active field values
@@ -272,7 +271,11 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
272271
};
273272

274273
try {
275-
$.plot(this.element, series, flotOptions);
274+
$.plot(
275+
this.element,
276+
series.filter(s => s.isVisible),
277+
flotOptions
278+
);
276279
} catch (err) {
277280
console.log('Graph rendering error', err, flotOptions, series);
278281
throw new Error('Error rendering panel');

packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const GraphWithLegend: React.FunctionComponent<GraphWithLegendProps> = (p
9494
<div className={wrapper}>
9595
<div className={graphContainer}>
9696
<Graph
97-
series={series.filter(s => !!s.isVisible)}
97+
series={series}
9898
timeRange={timeRange}
9999
timeZone={timeZone}
100100
showLines={showLines}

0 commit comments

Comments
 (0)