Skip to content

Commit db97145

Browse files
authored
feat(issues): Add markline for total/matching chart (#90708)
this pr adds a markline to the chart for if there's a search so the chart shows total/matching events. will make it easier to parse the charts in sections like Related Issues before: <img width="173" alt="Screenshot 2025-04-30 at 3 31 18 PM" src="https://github.com/user-attachments/assets/e1a40cde-a2a0-47c1-8dd0-fef362eff9d8" /> after: <img width="186" alt="Screenshot 2025-04-30 at 3 31 32 PM" src="https://github.com/user-attachments/assets/84167775-3ad5-41a7-9338-e9dae955efb2" />
1 parent 1d1e408 commit db97145

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

static/app/components/charts/groupStatusChart.tsx

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,45 @@ function GroupStatusChart({
5555

5656
const formattedMarkLine = formatAbbreviatedNumber(max);
5757

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+
5891
if (showSecondaryPoints && secondaryStats?.length) {
5992
const series: Series[] = [
6093
{
6194
seriesName: t('Total Events'),
6295
data: secondaryStats.map(asChartPoint),
96+
markLine: showMarkLine && max > 0 ? markLine : undefined,
6397
},
6498
{
6599
seriesName: t('Matching Events'),
@@ -70,45 +104,11 @@ function GroupStatusChart({
70104
return {colors: undefined, emphasisColors: undefined, series};
71105
}
72106

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-
81107
const series: Series[] = [
82108
{
83109
seriesName: t('Events'),
84110
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,
112112
},
113113
];
114114

0 commit comments

Comments
 (0)