refactor: update scroll modal
This commit is contained in:
@@ -151,7 +151,7 @@ export default function useChartConfig() {
|
||||
progress: {
|
||||
show: true,
|
||||
roundCap: false,
|
||||
width: 12
|
||||
width: 10
|
||||
},
|
||||
pointer: {
|
||||
length: '80%',
|
||||
@@ -163,7 +163,7 @@ export default function useChartConfig() {
|
||||
axisLine: {
|
||||
roundCap: false,
|
||||
lineStyle: {
|
||||
width: 12,
|
||||
width: 10,
|
||||
color: [
|
||||
[0.5, 'rgba(84, 204, 152, 80%)'],
|
||||
[0.8, 'rgba(250, 173, 20, 80%)'],
|
||||
|
||||
@@ -22,13 +22,18 @@ const GaugeChart: React.FC<Omit<ChartProps, 'seriesData' | 'xAxisData'>> = (
|
||||
title: titleConfig,
|
||||
chartColorMap
|
||||
} = useChartConfig();
|
||||
const { value, height, width, labelFormatter, title, color } = props;
|
||||
const { value, height, width, labelFormatter, title, color, gaugeConfig } =
|
||||
props;
|
||||
if (!value && value !== 0) {
|
||||
return <EmptyData height={height} title={title}></EmptyData>;
|
||||
}
|
||||
|
||||
const setDataOptions = () => {
|
||||
const colorValue = color || strokeColorFunc(value);
|
||||
const combineGaugeConfig = {
|
||||
...gaugeItemConfig,
|
||||
...gaugeConfig
|
||||
};
|
||||
return {
|
||||
title: {
|
||||
...titleConfig,
|
||||
@@ -38,11 +43,11 @@ const GaugeChart: React.FC<Omit<ChartProps, 'seriesData' | 'xAxisData'>> = (
|
||||
},
|
||||
series: [
|
||||
{
|
||||
...gaugeItemConfig,
|
||||
...combineGaugeConfig,
|
||||
axisLine: {
|
||||
...gaugeItemConfig.axisLine,
|
||||
...combineGaugeConfig.axisLine,
|
||||
lineStyle: {
|
||||
...gaugeItemConfig.axisLine.lineStyle,
|
||||
...combineGaugeConfig.axisLine.lineStyle,
|
||||
color: [
|
||||
[value / 100, colorValue],
|
||||
[1, chartColorMap.gaugeBgColor]
|
||||
|
||||
@@ -13,6 +13,12 @@ export interface ChartProps {
|
||||
smooth?: boolean;
|
||||
color?: string;
|
||||
yAxisName?: string;
|
||||
gaugeConfig?: {
|
||||
radius?: string;
|
||||
center?: string[];
|
||||
startAngle?: number;
|
||||
endAngle?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AreaChartItemProps {
|
||||
|
||||
Reference in New Issue
Block a user