mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tooltip: Fix issue with tooltip throwing an error when retrieving values (#20565)
This commit is contained in:
parent
83fa91b1f4
commit
caff9146ea
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user