fix: delete worker

This commit is contained in:
jialin
2024-07-10 17:14:55 +08:00
parent 0ed7568859
commit 8607815240
14 changed files with 129 additions and 16 deletions
+9 -2
View File
@@ -1,3 +1,4 @@
import { isFunction } from 'lodash';
const chartColorMap = {
tickLineColor: 'rgba(217,217,217,0.5)',
axislabelColor: 'rgba(0, 0, 0, 0.4)'
@@ -8,15 +9,18 @@ export const tooltip = {
// axisPointer: {
// type: 'shadow'
// }
formatter(params: any) {
formatter(params: any, callback?: (val: any) => any) {
let result = `<span class="tooltip-x-name">${params[0].axisValue}</span>`;
params.forEach((item: any) => {
let value = isFunction(callback)
? callback?.(item.data.value)
: item.data.value;
result += `<span class="tooltip-item">
<span class="tooltip-item-name">
<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:${item.color};"></span>
<span class="tooltip-title">${item.seriesName}</span>:
</span>
<span class="tooltip-value">${item.data.value}</span>
<span class="tooltip-value">${value}</span>
</span>`;
});
return `<div class="tooltip-wrapper">${result}</div>`;
@@ -55,6 +59,9 @@ export const xAxis = {
export const yAxis = {
// max: 100,
// min: 0,
nameTextStyle: {
padding: [0, 0, 0, -25]
},
splitLine: {
show: true,
lineStyle: {
+10 -2
View File
@@ -17,9 +17,11 @@ const LineChart: React.FC<ChartProps> = (props) => {
const {
seriesData,
xAxisData,
yAxisName,
height,
width,
labelFormatter,
tooltipValueFormatter = null,
legendData = [],
smooth,
title
@@ -34,7 +36,12 @@ const LineChart: React.FC<ChartProps> = (props) => {
},
grid,
tooltip: {
...tooltip
...tooltip,
formatter(params: any) {
return tooltipValueFormatter
? tooltip.formatter(params, tooltipValueFormatter)
: tooltip.formatter(params);
}
},
xAxis: {
...xAxis,
@@ -76,7 +83,8 @@ const LineChart: React.FC<ChartProps> = (props) => {
text: title
},
yAxis: {
...options.yAxis
...options.yAxis,
name: yAxisName
},
xAxis: {
...options.xAxis,
+2
View File
@@ -3,12 +3,14 @@ export interface ChartProps {
xAxisData: string[];
legendData?: string[];
labelFormatter?: (val?: any) => string;
tooltipValueFormatter?: (val?: any) => string;
height: string | number;
width?: string | number;
title?: string;
value?: number;
smooth?: boolean;
color?: string;
yAxisName?: string;
}
export interface AreaChartItemProps {