11import styled from '@emotion/styled' ;
22
33import { BarChart } from 'sentry/components/charts/barChart' ;
4- import ChartZoom from 'sentry/components/charts/chartZoom' ;
54import { HeaderTitleLegend } from 'sentry/components/charts/styles' ;
5+ import { useChartZoom } from 'sentry/components/charts/useChartZoom' ;
66import type { DateTimeObject } from 'sentry/components/charts/utils' ;
77import LoadingError from 'sentry/components/loadingError' ;
88import Panel from 'sentry/components/panels/panel' ;
@@ -28,6 +28,7 @@ export function AutomationStatsChart({
2828 utc,
2929} : IssueAlertDetailsProps ) {
3030 const organization = useOrganization ( ) ;
31+ const chartZoomProps = useChartZoom ( { saveOnZoom : true } ) ;
3132 const {
3233 data : fireHistory ,
3334 isPending,
@@ -59,37 +60,32 @@ export function AutomationStatsChart({
5960 { isPending && < Placeholder height = "200px" /> }
6061 { isError && < LoadingError /> }
6162 { fireHistory && (
62- < ChartZoom period = { period } start = { start } end = { end } utc = { utc } usePageDate >
63- { zoomRenderProps => (
64- < BarChart
65- { ...zoomRenderProps }
66- isGroupedByDate
67- showTimeInTooltip
68- grid = { {
69- left : space ( 0.25 ) ,
70- right : space ( 2 ) ,
71- top : space ( 3 ) ,
72- bottom : 0 ,
73- } }
74- yAxis = { {
75- minInterval : 1 ,
76- } }
77- series = { [
78- {
79- seriesName : t ( 'Alerts Triggered' ) ,
80- data :
81- fireHistory ?. map ( automation => ( {
82- name : automation . date ,
83- value : automation . count ,
84- } ) ) ?? [ ] ,
85- emphasis : {
86- disabled : true ,
87- } ,
88- } ,
89- ] }
90- />
91- ) }
92- </ ChartZoom >
63+ < BarChart
64+ { ...chartZoomProps }
65+ showTimeInTooltip
66+ grid = { {
67+ left : space ( 0.25 ) ,
68+ right : space ( 2 ) ,
69+ top : space ( 3 ) ,
70+ bottom : 0 ,
71+ } }
72+ yAxis = { {
73+ minInterval : 1 ,
74+ } }
75+ series = { [
76+ {
77+ seriesName : t ( 'Alerts Triggered' ) ,
78+ data : fireHistory . map ( automation => ( {
79+ name : automation . date ,
80+ value : automation . count ,
81+ } ) ) ,
82+ emphasis : {
83+ disabled : true ,
84+ } ,
85+ animation : false ,
86+ } ,
87+ ] }
88+ />
9389 ) }
9490 </ StyledPanelBody >
9591 < ChartFooter >
0 commit comments