fix: dashboard re-render
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
yAxis
|
||||
} from '@/components/echarts/config';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { memo, useEffect, useState } from 'react';
|
||||
import { ChartProps } from './types';
|
||||
|
||||
const BarChart: React.FC<ChartProps> = (props) => {
|
||||
@@ -90,4 +90,4 @@ const BarChart: React.FC<ChartProps> = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default BarChart;
|
||||
export default memo(BarChart);
|
||||
|
||||
@@ -37,7 +37,6 @@ export const legend = {
|
||||
|
||||
export const xAxis = {
|
||||
type: 'category',
|
||||
boundaryGap: true,
|
||||
axisTick: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
yAxis
|
||||
} from '@/components/echarts/config';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { memo, useEffect, useState } from 'react';
|
||||
import { ChartProps } from './types';
|
||||
|
||||
const BarChart: React.FC<ChartProps> = (props) => {
|
||||
@@ -87,7 +87,6 @@ const BarChart: React.FC<ChartProps> = (props) => {
|
||||
},
|
||||
xAxis: {
|
||||
...options.xAxis,
|
||||
boundaryGap: true,
|
||||
type: 'value',
|
||||
splitLine: {
|
||||
show: false
|
||||
@@ -113,4 +112,4 @@ const BarChart: React.FC<ChartProps> = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default BarChart;
|
||||
export default memo(BarChart);
|
||||
|
||||
Reference in New Issue
Block a user