1- import { useState , useMemo , useEffect , useRef , useCallback } from 'react' ;
1+ import { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
22
33import {
44 Chart ,
@@ -7,21 +7,26 @@ import {
77 ChartGroup ,
88 ChartLabel ,
99 ChartLegend ,
10- ChartTooltip ,
1110 ChartVoronoiContainer ,
1211} from '@patternfly/react-charts/victory' ;
13- import { Card , CardBody , CardTitle , EmptyState , EmptyStateBody } from '@patternfly/react-core' ;
14- import { createAlertsChartBars , formatDate , generateDateArray } from '../utils' ;
15- import { getResizeObserver } from '@patternfly/react-core' ;
16- import { useDispatch , useSelector } from 'react-redux' ;
17- import { setAlertsAreLoading } from '../../../actions/observe' ;
12+ import {
13+ Card ,
14+ CardBody ,
15+ CardTitle ,
16+ EmptyState ,
17+ EmptyStateBody ,
18+ getResizeObserver ,
19+ } from '@patternfly/react-core' ;
1820import {
1921 t_global_color_status_danger_default ,
2022 t_global_color_status_info_default ,
2123 t_global_color_status_warning_default ,
2224} from '@patternfly/react-tokens' ;
25+ import { useDispatch , useSelector } from 'react-redux' ;
26+ import { setAlertsAreLoading } from '../../../actions/observe' ;
2327import { MonitoringState } from '../../../reducers/observe' ;
24- import { VictoryPortal } from 'victory' ;
28+ import { IncidentsTooltip } from '../IncidentsTooltip' ;
29+ import { createAlertsChartBars , formatDate , generateDateArray } from '../utils' ;
2530
2631const AlertsChart = ( { chartDays, theme } : { chartDays : number ; theme : 'light' | 'dark' } ) => {
2732 const dispatch = useDispatch ( ) ;
@@ -96,16 +101,7 @@ const AlertsChart = ({ chartDays, theme }: { chartDays: number; theme: 'light' |
96101 < Chart
97102 containerComponent = {
98103 < ChartVoronoiContainer
99- labelComponent = {
100- < VictoryPortal >
101- < ChartTooltip
102- orientation = "top"
103- dx = { ( { x, x0 } : any ) => - ( x - x0 ) / 2 }
104- dy = { - 5 } // Position tooltip so pointer appears above bar
105- labelComponent = { < ChartLabel /> }
106- />
107- </ VictoryPortal >
108- }
104+ labelComponent = { < IncidentsTooltip /> }
109105 labels = { ( { datum } ) => {
110106 if ( datum . nodata ) {
111107 return null ;
0 commit comments