mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 17:39:03 +08:00
fix: Changed axis label color (#2080)
* fix: Changed axis label color * fix: linting issues * chore: helpers is updated Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
1e39131c38
commit
fa652be926
8
frontend/src/components/Graph/helpers.ts
Normal file
8
frontend/src/components/Graph/helpers.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { themeColors } from 'constants/theme';
|
||||||
|
|
||||||
|
export const getAxisLabelColor = (currentTheme: string): string => {
|
||||||
|
if (currentTheme === 'light') {
|
||||||
|
return themeColors.black;
|
||||||
|
}
|
||||||
|
return themeColors.whiteCream;
|
||||||
|
};
|
@ -27,6 +27,7 @@ import { useIsDarkMode } from 'hooks/useDarkMode';
|
|||||||
import React, { useCallback, useEffect, useRef } from 'react';
|
import React, { useCallback, useEffect, useRef } from 'react';
|
||||||
|
|
||||||
import { hasData } from './hasData';
|
import { hasData } from './hasData';
|
||||||
|
import { getAxisLabelColor } from './helpers';
|
||||||
import { legend } from './Plugin';
|
import { legend } from './Plugin';
|
||||||
import {
|
import {
|
||||||
createDragSelectPlugin,
|
createDragSelectPlugin,
|
||||||
@ -200,6 +201,7 @@ function Graph({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: 'time',
|
type: 'time',
|
||||||
|
ticks: { color: getAxisLabelColor(currentTheme) },
|
||||||
},
|
},
|
||||||
y: {
|
y: {
|
||||||
display: true,
|
display: true,
|
||||||
@ -208,6 +210,7 @@ function Graph({
|
|||||||
color: getGridColor(),
|
color: getGridColor(),
|
||||||
},
|
},
|
||||||
ticks: {
|
ticks: {
|
||||||
|
color: getAxisLabelColor(currentTheme),
|
||||||
// Include a dollar sign in the ticks
|
// Include a dollar sign in the ticks
|
||||||
callback(value) {
|
callback(value) {
|
||||||
return getYAxisFormattedValue(value.toString(), yAxisUnit);
|
return getYAxisFormattedValue(value.toString(), yAxisUnit);
|
||||||
|
@ -33,6 +33,8 @@ const themeColors = {
|
|||||||
rust: '#B33300',
|
rust: '#B33300',
|
||||||
},
|
},
|
||||||
errorColor: '#d32f2f',
|
errorColor: '#d32f2f',
|
||||||
|
whiteCream: '#ffffffd5',
|
||||||
|
black: '#000000',
|
||||||
};
|
};
|
||||||
|
|
||||||
export { themeColors };
|
export { themeColors };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user