@@ -55,11 +55,45 @@ function GroupStatusChart({
55
55
56
56
const formattedMarkLine = formatAbbreviatedNumber ( max ) ;
57
57
58
+ const marklineColor = isChonkTheme ( theme )
59
+ ? theme . colors . content . muted
60
+ : theme . gray200 ;
61
+ const marklineLabelColor = isChonkTheme ( theme )
62
+ ? theme . colors . content . primary
63
+ : theme . gray300 ;
64
+ const chartColor = isChonkTheme ( theme ) ? theme . colors . content . primary : theme . gray300 ;
65
+
66
+ const markLine = MarkLine ( {
67
+ silent : true ,
68
+ lineStyle : {
69
+ color : marklineColor ,
70
+ type : [ 4 , 3 ] , // Sets line type to "dashed" with 4 length and 3 gap
71
+ opacity : 0.6 ,
72
+ cap : 'round' , // Rounded edges for the dashes
73
+ } ,
74
+ data : [
75
+ {
76
+ type : 'max' ,
77
+ } ,
78
+ ] ,
79
+ animation : false ,
80
+ label : {
81
+ show : true ,
82
+ position : 'end' ,
83
+ opacity : 1 ,
84
+ color : marklineLabelColor ,
85
+ fontFamily : 'Rubik' ,
86
+ fontSize : 10 ,
87
+ formatter : `${ formattedMarkLine } ` ,
88
+ } ,
89
+ } ) ;
90
+
58
91
if ( showSecondaryPoints && secondaryStats ?. length ) {
59
92
const series : Series [ ] = [
60
93
{
61
94
seriesName : t ( 'Total Events' ) ,
62
95
data : secondaryStats . map ( asChartPoint ) ,
96
+ markLine : showMarkLine && max > 0 ? markLine : undefined ,
63
97
} ,
64
98
{
65
99
seriesName : t ( 'Matching Events' ) ,
@@ -70,45 +104,11 @@ function GroupStatusChart({
70
104
return { colors : undefined , emphasisColors : undefined , series} ;
71
105
}
72
106
73
- const marklineColor = isChonkTheme ( theme )
74
- ? theme . colors . content . muted
75
- : theme . gray200 ;
76
- const marklineLabelColor = isChonkTheme ( theme )
77
- ? theme . colors . content . primary
78
- : theme . gray300 ;
79
- const chartColor = isChonkTheme ( theme ) ? theme . colors . content . primary : theme . gray300 ;
80
-
81
107
const series : Series [ ] = [
82
108
{
83
109
seriesName : t ( 'Events' ) ,
84
110
data : stats . map ( asChartPoint ) ,
85
- markLine :
86
- showMarkLine && max > 0
87
- ? MarkLine ( {
88
- silent : true ,
89
- lineStyle : {
90
- color : marklineColor ,
91
- type : [ 4 , 3 ] , // Sets line type to "dashed" with 4 length and 3 gap
92
- opacity : 0.6 ,
93
- cap : 'round' , // Rounded edges for the dashes
94
- } ,
95
- data : [
96
- {
97
- type : 'max' ,
98
- } ,
99
- ] ,
100
- animation : false ,
101
- label : {
102
- show : true ,
103
- position : 'end' ,
104
- opacity : 1 ,
105
- color : marklineLabelColor ,
106
- fontFamily : 'Rubik' ,
107
- fontSize : 10 ,
108
- formatter : `${ formattedMarkLine } ` ,
109
- } ,
110
- } )
111
- : undefined ,
111
+ markLine : showMarkLine && max > 0 ? markLine : undefined ,
112
112
} ,
113
113
] ;
114
114
0 commit comments