Skip to content

Commit bdd12bd

Browse files
committed
Fix performance graph color issues
1 parent 57e48ad commit bdd12bd

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

Plan/react/dashboard/src/components/cards/server/graphs/GraphSeriesCard.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
177177
}
178178
}, {
179179
id: PerformanceGraphId.TPS,
180-
name: t('html.label.tps'), icon: faTachometerAlt, color: 'tps',
180+
name: t('html.label.tps'), icon: faTachometerAlt,
181+
color: 'var(--color-data-performance-tps)',
181182
permission: 'page.server.performance.graphs.tps',
182183
data: performanceSeries?.tps,
183184
options: {
@@ -187,7 +188,7 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
187188
}
188189
}, {
189190
id: PerformanceGraphId.MSPT_AVG,
190-
name: t('html.label.msptAverage'), icon: faStopwatch, color: 'mspt-average',
191+
name: t('html.label.msptAverage'), icon: faStopwatch, color: 'var(--color-data-performance-mspt-average)',
191192
permission: 'page.server.performance.graphs.mspt',
192193
data: performanceSeries?.msptAverage,
193194
options: {
@@ -197,7 +198,9 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
197198
}
198199
}, {
199200
id: PerformanceGraphId.MSPT_95TH,
200-
name: t('html.label.msptPercentile', {percentile: 95}), icon: faStopwatch, color: 'mspt-percentile',
201+
name: t('html.label.msptPercentile', {percentile: 95}),
202+
icon: faStopwatch,
203+
color: 'var(--color-data-performance-mspt-percentile)',
201204
permission: 'page.server.performance.graphs.mspt',
202205
data: performanceSeries?.mspt95thPercentile,
203206
options: {
@@ -208,7 +211,7 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
208211
}, {
209212
id: PerformanceGraphId.MSPT_JITTER_AVG,
210213
name: t('html.label.msptJitterAverage'),
211-
icon: faWaveSquare, color: 'mspt-average',
214+
icon: faWaveSquare, color: 'var(--color-data-performance-mspt-average)',
212215
permission: 'page.server.performance.graphs.mspt',
213216
data: performanceSeries?.msptJitterAverage,
214217
options: {
@@ -219,7 +222,8 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
219222
}, {
220223
id: PerformanceGraphId.MSPT_JITTER_MAX,
221224
name: t('html.label.msptJitterMax'),
222-
icon: faWaveSquare, color: 'mspt-percentile',
225+
icon: faWaveSquare,
226+
color: 'var(--color-data-performance-mspt-percentile)',
223227
permission: 'page.server.performance.graphs.mspt',
224228
data: performanceSeries?.msptJitterMax,
225229
options: {
@@ -344,7 +348,7 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
344348
name: series.name,
345349
type: series.options.type,
346350
tooltip: series.options.tooltip,
347-
color: `var(--color-graphs-${series.color})`,
351+
color: series.color.includes("var(") ? series.color : `var(--color-graphs-${series.color})`,
348352
zones: zones[series.id] || undefined,
349353
yAxis: Object.entries(yAxis).findIndex(([id]) => id === series.options.yAxis)
350354
}));
@@ -438,7 +442,8 @@ export const GraphSeriesCard = ({id, identifier}: Props) => {
438442
}}
439443
onClick={() => toggleSeries(series.id)}>
440444
<FontAwesomeIcon icon={'data' in series && series.data ? series.icon : faGear}
441-
className={"col-" + series.color + ('data' in series && series.data ? '' : ' fa-spin')}/>
445+
style={{color: series.color.includes("var(") ? series.color : `var(--color-graphs-${series.color})`}}
446+
className={'data' in series && series.data ? '' : ' fa-spin'}/>
442447
{' '}
443448
<small>{series.name}</small>
444449
</button>

0 commit comments

Comments
 (0)