Fix an issue where new dashboard graphs are partially following theme colors. #5958

pull/5954/head
Aditya Toshniwal 2023-03-16 17:21:56 +05:30 committed by GitHub
parent 7b18ce10fe
commit 37c0de5d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import UplotReact from 'uplot-react';
import { useResizeDetector } from 'react-resize-detector';
import gettext from 'sources/gettext';
import PropTypes from 'prop-types';
import { useTheme } from '@material-ui/styles';
function tooltipPlugin(refreshRate) {
let tooltipTopOffset = -20;
@ -59,6 +60,7 @@ function tooltipPlugin(refreshRate) {
export default function StreamingChart({xRange=75, data, options}) {
const chartRef = useRef();
const theme = useTheme();
const { width, height, ref:containerRef } = useResizeDetector();
const defaultOptions = useMemo(()=>({
title: '',
@ -91,8 +93,14 @@ export default function StreamingChart({xRange=75, data, options}) {
axes: [
{
show: false,
stroke: theme.palette.text.primary,
},
{
grid: {
stroke: theme.otherVars.borderColor,
width: 0.5,
},
stroke: theme.palette.text.primary,
size: function(_obj, values) {
let size = 40;
if(values?.length > 0) {