Commit caff9146 by Dominik Prokop Committed by GitHub

Tooltip: Fix issue with tooltip throwing an error when retrieving values (#20565)

parent 83fa91b1
......@@ -139,7 +139,6 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
// Check if tooltip needs to be rendered with custom tooltip component, otherwise default to GraphTooltip
const tooltipContentRenderer = tooltipElementProps.tooltipComponent || GraphTooltip;
// Indicates column(field) index in y-axis dimension
const seriesIndex = activeItem ? activeItem.series.seriesIndex : 0;
// Indicates row index in active field values
......@@ -272,7 +271,11 @@ export class Graph extends PureComponent<GraphProps, GraphState> {
};
try {
$.plot(this.element, series, flotOptions);
$.plot(
this.element,
series.filter(s => s.isVisible),
flotOptions
);
} catch (err) {
console.log('Graph rendering error', err, flotOptions, series);
throw new Error('Error rendering panel');
......
......@@ -94,7 +94,7 @@ export const GraphWithLegend: React.FunctionComponent<GraphWithLegendProps> = (p
<div className={wrapper}>
<div className={graphContainer}>
<Graph
series={series.filter(s => !!s.isVisible)}
series={series}
timeRange={timeRange}
timeZone={timeZone}
showLines={showLines}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment