File tree 1 file changed +10
-30
lines changed
static/app/views/insights/cache/components/charts 1 file changed +10
-30
lines changed Original file line number Diff line number Diff line change 1
- import { useTheme } from '@emotion/react' ;
2
-
3
- import type { Series } from 'sentry/types/echarts' ;
4
- import { formatPercentage } from 'sentry/utils/number/formatPercentage' ;
5
- import { CHART_HEIGHT } from 'sentry/views/insights/cache/settings' ;
6
- import { AVG_COLOR } from 'sentry/views/insights/colors' ;
7
- import Chart , { ChartType } from 'sentry/views/insights/common/components/chart' ;
8
- import ChartPanel from 'sentry/views/insights/common/components/chartPanel' ;
1
+ import { InsightsLineChartWidget } from 'sentry/views/insights/common/components/insightsLineChartWidget' ;
2
+ import type { DiscoverSeries } from 'sentry/views/insights/common/queries/useDiscoverSeries' ;
9
3
import { DataTitles } from 'sentry/views/insights/common/views/spans/types' ;
10
4
11
5
type Props = {
12
6
isLoading : boolean ;
13
- series : Series ;
7
+ series : DiscoverSeries ;
14
8
error ?: Error | null ;
15
9
} ;
16
10
17
11
export function CacheHitMissChart ( { series, isLoading, error} : Props ) {
18
- const theme = useTheme ( ) ;
19
12
return (
20
- < ChartPanel title = { DataTitles [ `cache_miss_rate()` ] } >
21
- < Chart
22
- height = { CHART_HEIGHT }
23
- grid = { {
24
- left : '4px' ,
25
- right : '0' ,
26
- top : '8px' ,
27
- bottom : '0' ,
28
- } }
29
- data = { [ series ] }
30
- loading = { isLoading }
31
- error = { error }
32
- chartColors = { [ AVG_COLOR ( theme ) ] }
33
- type = { ChartType . LINE }
34
- aggregateOutputFormat = "percentage"
35
- tooltipFormatterOptions = { {
36
- valueFormatter : value => formatPercentage ( value ) ,
37
- } }
38
- />
39
- </ ChartPanel >
13
+ < InsightsLineChartWidget
14
+ title = { DataTitles [ `cache_miss_rate()` ] }
15
+ series = { [ series ] }
16
+ showLegend = "never"
17
+ isLoading = { isLoading }
18
+ error = { error ?? null }
19
+ />
40
20
) ;
41
21
}
You can’t perform that action at this time.
0 commit comments