diff --git a/packages/grafana-ui/src/components/Graph/Graph.tsx b/packages/grafana-ui/src/components/Graph/Graph.tsx index 1416c21114f..af457a30bbf 100644 --- a/packages/grafana-ui/src/components/Graph/Graph.tsx +++ b/packages/grafana-ui/src/components/Graph/Graph.tsx @@ -139,7 +139,6 @@ export class Graph extends PureComponent { // 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 { }; 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'); diff --git a/packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx b/packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx index 0f20d6068be..c4a6aad7d48 100644 --- a/packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx +++ b/packages/grafana-ui/src/components/Graph/GraphWithLegend.tsx @@ -94,7 +94,7 @@ export const GraphWithLegend: React.FunctionComponent = (p
!!s.isVisible)} + series={series} timeRange={timeRange} timeZone={timeZone} showLines={showLines}