win-chart 2.13.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -7
- package/dist/cjs/components/ChartWrapper.cjs +39 -0
- package/dist/cjs/components/EarthChart.cjs +168 -0
- package/dist/cjs/components/GanttChart.cjs +302 -0
- package/dist/cjs/components/WinChart.cjs +125 -0
- package/dist/cjs/index.cjs +58 -0
- package/dist/cjs/types/index.cjs +51 -0
- package/dist/cjs/utils/const.cjs +68 -0
- package/dist/cjs/utils/data.cjs +9382 -0
- package/dist/cjs/utils/earthMockData.cjs +6017 -0
- package/dist/cjs/utils/getAreaSpec.cjs +143 -0
- package/dist/cjs/utils/getBarSpec.cjs +171 -0
- package/dist/cjs/utils/getChartOptions.cjs +78 -0
- package/dist/cjs/utils/getColumnSpec.cjs +127 -0
- package/dist/cjs/utils/getDualSpec.cjs +171 -0
- package/dist/cjs/utils/getFunnelSpec.cjs +89 -0
- package/dist/cjs/utils/getLineSpec.cjs +72 -0
- package/dist/cjs/utils/getPieSpec.cjs +140 -0
- package/dist/cjs/utils/getRadarSpec.cjs +100 -0
- package/dist/cjs/utils/tool.cjs +240 -0
- package/dist/esm/components/ChartWrapper.js +5 -0
- package/dist/esm/components/EarthChart.js +134 -0
- package/dist/esm/components/GanttChart.js +268 -0
- package/dist/esm/components/WinChart.js +79 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/types/index.js +17 -0
- package/dist/esm/utils/const.js +31 -0
- package/dist/esm/utils/data.js +9342 -0
- package/dist/esm/utils/earthMockData.js +5983 -0
- package/dist/esm/utils/getAreaSpec.js +106 -0
- package/dist/esm/utils/getBarSpec.js +134 -0
- package/dist/esm/utils/getChartOptions.js +44 -0
- package/dist/esm/utils/getColumnSpec.js +90 -0
- package/dist/esm/utils/getDualSpec.js +134 -0
- package/dist/esm/utils/getFunnelSpec.js +55 -0
- package/dist/esm/utils/getLineSpec.js +38 -0
- package/dist/esm/utils/getPieSpec.js +103 -0
- package/dist/esm/utils/getRadarSpec.js +66 -0
- package/dist/esm/utils/tool.js +146 -0
- package/dist/index.js +1219 -0
- package/dist/types/components/GanttChart.d.ts +0 -1
- package/dist/types/demos/DualSystemComparisonChart.d.ts +1 -0
- package/dist/types/demos/EastWestResourceComparisonChart.d.ts +1 -0
- package/dist/types/demos/PolicyGrowthChart.d.ts +1 -0
- package/dist/types/demos/PolicyOpennessChart.d.ts +1 -0
- package/dist/types/demos/PracticalUsageTrendChart.d.ts +1 -0
- package/dist/types/demos/index.d.ts +5 -0
- package/dist/types/types/index.d.ts +14 -14
- package/dist/types/utils/getAreaSpec.d.ts +1 -1
- package/dist/types/utils/getBarSpec.d.ts +1 -1
- package/dist/types/utils/getChartOptions.d.ts +1 -1
- package/dist/types/utils/getColumnSpec.d.ts +1 -1
- package/dist/types/utils/getDualSpec.d.ts +1 -1
- package/dist/types/utils/getFunnelSpec.d.ts +1 -1
- package/dist/types/utils/getLineSpec.d.ts +1 -1
- package/dist/types/utils/getPieSpec.d.ts +1 -1
- package/dist/types/utils/getRadarSpec.d.ts +1 -1
- package/dist/types/utils/tool.d.ts +59 -3
- package/package.json +33 -32
- package/dist/bundle.esm.js +0 -22
- package/dist/index.d.ts +0 -147
- package/dist/types/app.d.ts +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getMiniAreaOpt: ()=>getMiniAreaOpt,
|
|
28
|
+
getAreaOpt: ()=>getAreaOpt
|
|
29
|
+
});
|
|
30
|
+
const external_const_cjs_namespaceObject = require("./const.cjs");
|
|
31
|
+
const external_tool_cjs_namespaceObject = require("./tool.cjs");
|
|
32
|
+
const getMiniAreaOpt = (winChartProps)=>{
|
|
33
|
+
const areaTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
34
|
+
const color = winChartProps.color;
|
|
35
|
+
return {
|
|
36
|
+
color,
|
|
37
|
+
grid: {
|
|
38
|
+
top: 4,
|
|
39
|
+
left: 0,
|
|
40
|
+
right: 0,
|
|
41
|
+
bottom: 0,
|
|
42
|
+
containLabel: true
|
|
43
|
+
},
|
|
44
|
+
tooltip: {
|
|
45
|
+
trigger: 'axis',
|
|
46
|
+
axisPointer: {
|
|
47
|
+
type: 'cross',
|
|
48
|
+
label: {
|
|
49
|
+
backgroundColor: '#999'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
legend: {
|
|
54
|
+
show: false
|
|
55
|
+
},
|
|
56
|
+
xAxis: {
|
|
57
|
+
show: false,
|
|
58
|
+
boundaryGap: false,
|
|
59
|
+
data: (0, external_tool_cjs_namespaceObject.getMainAxisLabels)(winChartProps)
|
|
60
|
+
},
|
|
61
|
+
yAxis: {
|
|
62
|
+
show: false,
|
|
63
|
+
min: winChartProps.yStart?.at(0)
|
|
64
|
+
},
|
|
65
|
+
series: [
|
|
66
|
+
...areaTypeList.map((type, index)=>{
|
|
67
|
+
const areaColor = color?.[index] ?? external_const_cjs_namespaceObject.COLOR_LIST[index];
|
|
68
|
+
return {
|
|
69
|
+
name: type,
|
|
70
|
+
type: 'line',
|
|
71
|
+
smooth: true,
|
|
72
|
+
lineStyle: {
|
|
73
|
+
width: 2
|
|
74
|
+
},
|
|
75
|
+
showSymbol: false,
|
|
76
|
+
areaStyle: {
|
|
77
|
+
opacity: 0.8,
|
|
78
|
+
color: (0, external_tool_cjs_namespaceObject.getGradientColor)(winChartProps, areaColor)
|
|
79
|
+
},
|
|
80
|
+
emphasis: {
|
|
81
|
+
focus: 'series'
|
|
82
|
+
},
|
|
83
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
84
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type)
|
|
85
|
+
};
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
const getAreaOpt = (winChartProps)=>{
|
|
91
|
+
const areaTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
92
|
+
return {
|
|
93
|
+
tooltip: {
|
|
94
|
+
trigger: 'axis',
|
|
95
|
+
axisPointer: {
|
|
96
|
+
type: 'cross',
|
|
97
|
+
label: {
|
|
98
|
+
backgroundColor: '#999'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
legend: {
|
|
103
|
+
bottom: 0,
|
|
104
|
+
type: 'scroll'
|
|
105
|
+
},
|
|
106
|
+
xAxis: (0, external_tool_cjs_namespaceObject.getXAxisOpt)(winChartProps),
|
|
107
|
+
yAxis: {
|
|
108
|
+
min: winChartProps.yStart?.at(0)
|
|
109
|
+
},
|
|
110
|
+
series: [
|
|
111
|
+
...areaTypeList.map((type, index)=>{
|
|
112
|
+
const areaColor = external_const_cjs_namespaceObject.COLOR_LIST[index];
|
|
113
|
+
return {
|
|
114
|
+
name: type,
|
|
115
|
+
type: 'line',
|
|
116
|
+
smooth: true,
|
|
117
|
+
lineStyle: {
|
|
118
|
+
width: 2
|
|
119
|
+
},
|
|
120
|
+
areaStyle: {
|
|
121
|
+
opacity: 0.8,
|
|
122
|
+
color: (0, external_tool_cjs_namespaceObject.getGradientColor)(winChartProps, areaColor)
|
|
123
|
+
},
|
|
124
|
+
emphasis: {
|
|
125
|
+
focus: 'series'
|
|
126
|
+
},
|
|
127
|
+
showSymbol: winChartProps.showLabel,
|
|
128
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
129
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type)
|
|
130
|
+
};
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
exports.getAreaOpt = __webpack_exports__.getAreaOpt;
|
|
136
|
+
exports.getMiniAreaOpt = __webpack_exports__.getMiniAreaOpt;
|
|
137
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
138
|
+
"getAreaOpt",
|
|
139
|
+
"getMiniAreaOpt"
|
|
140
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
141
|
+
Object.defineProperty(exports, '__esModule', {
|
|
142
|
+
value: true
|
|
143
|
+
});
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getBarOpt: ()=>getBarOpt,
|
|
28
|
+
getStackBarOpt: ()=>getStackBarOpt
|
|
29
|
+
});
|
|
30
|
+
const external_tool_cjs_namespaceObject = require("./tool.cjs");
|
|
31
|
+
const getBarOpt = (winChartProps)=>({
|
|
32
|
+
tooltip: {
|
|
33
|
+
trigger: 'axis',
|
|
34
|
+
axisPointer: {
|
|
35
|
+
type: 'cross',
|
|
36
|
+
label: {
|
|
37
|
+
backgroundColor: '#999'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
legend: {
|
|
42
|
+
bottom: 0,
|
|
43
|
+
type: 'scroll'
|
|
44
|
+
},
|
|
45
|
+
xAxis: {},
|
|
46
|
+
yAxis: {
|
|
47
|
+
data: (0, external_tool_cjs_namespaceObject.getMainAxisLabels)(winChartProps),
|
|
48
|
+
axisTick: {
|
|
49
|
+
alignWithLabel: true
|
|
50
|
+
},
|
|
51
|
+
axisPointer: {
|
|
52
|
+
type: 'shadow'
|
|
53
|
+
},
|
|
54
|
+
min: winChartProps.yStart?.[0],
|
|
55
|
+
axisLabel: {
|
|
56
|
+
rotate: winChartProps.xAxisLabelRotate,
|
|
57
|
+
formatter: (name)=>(0, external_tool_cjs_namespaceObject.handleMainAxisLabel)(winChartProps, name)
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
series: (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps).map((type)=>({
|
|
61
|
+
name: type,
|
|
62
|
+
type: 'bar',
|
|
63
|
+
barGap: '30%',
|
|
64
|
+
barCategoryGap: '30%',
|
|
65
|
+
barMaxWidth: 8,
|
|
66
|
+
label: {
|
|
67
|
+
...(0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
68
|
+
position: 'right'
|
|
69
|
+
},
|
|
70
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type).map((item)=>({
|
|
71
|
+
value: item,
|
|
72
|
+
itemStyle: {
|
|
73
|
+
borderRadius: [
|
|
74
|
+
0,
|
|
75
|
+
500,
|
|
76
|
+
500,
|
|
77
|
+
0
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}))
|
|
81
|
+
}))
|
|
82
|
+
});
|
|
83
|
+
const getStackBarOpt = (winChartProps)=>{
|
|
84
|
+
const barTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
85
|
+
return {
|
|
86
|
+
grid: {
|
|
87
|
+
...winChartProps.showStackTotal && {
|
|
88
|
+
right: 32
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
tooltip: {
|
|
92
|
+
trigger: 'axis',
|
|
93
|
+
axisPointer: {
|
|
94
|
+
type: 'cross',
|
|
95
|
+
label: {
|
|
96
|
+
backgroundColor: '#999'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
legend: {
|
|
101
|
+
bottom: 0,
|
|
102
|
+
type: 'scroll',
|
|
103
|
+
data: barTypeList
|
|
104
|
+
},
|
|
105
|
+
xAxis: {},
|
|
106
|
+
yAxis: {
|
|
107
|
+
data: (0, external_tool_cjs_namespaceObject.getMainAxisLabels)(winChartProps),
|
|
108
|
+
axisTick: {
|
|
109
|
+
alignWithLabel: true
|
|
110
|
+
},
|
|
111
|
+
axisPointer: {
|
|
112
|
+
type: 'shadow'
|
|
113
|
+
},
|
|
114
|
+
min: winChartProps.yStart?.[0],
|
|
115
|
+
axisLabel: {
|
|
116
|
+
rotate: winChartProps.xAxisLabelRotate,
|
|
117
|
+
formatter: (name)=>(0, external_tool_cjs_namespaceObject.handleMainAxisLabel)(winChartProps, name)
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
series: [
|
|
121
|
+
...barTypeList.map((type)=>({
|
|
122
|
+
name: type,
|
|
123
|
+
type: 'bar',
|
|
124
|
+
stack: 'total',
|
|
125
|
+
barGap: '30%',
|
|
126
|
+
barCategoryGap: '30%',
|
|
127
|
+
barMaxWidth: 8,
|
|
128
|
+
label: {
|
|
129
|
+
...(0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
130
|
+
show: winChartProps.showLabel && !winChartProps.showStackTotal,
|
|
131
|
+
position: 'right'
|
|
132
|
+
},
|
|
133
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type)
|
|
134
|
+
})),
|
|
135
|
+
{
|
|
136
|
+
name: '总和',
|
|
137
|
+
type: 'bar',
|
|
138
|
+
stack: 'abc',
|
|
139
|
+
barGap: '-100%',
|
|
140
|
+
barMaxWidth: 8,
|
|
141
|
+
itemStyle: {
|
|
142
|
+
normal: {
|
|
143
|
+
color: 'transparent'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
tooltip: {
|
|
147
|
+
show: false
|
|
148
|
+
},
|
|
149
|
+
label: {
|
|
150
|
+
show: winChartProps.showStackTotal,
|
|
151
|
+
normal: {
|
|
152
|
+
show: true,
|
|
153
|
+
position: 'right',
|
|
154
|
+
color: '#000'
|
|
155
|
+
},
|
|
156
|
+
formatter: (params)=>String(Number((0, external_tool_cjs_namespaceObject.arraySum)(winChartProps.data?.filter((item)=>item.label === params.name).map((item)=>item.value)).toFixed(2)))
|
|
157
|
+
},
|
|
158
|
+
data: (0, external_tool_cjs_namespaceObject.aggregateStackData)(winChartProps.data ?? [])
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
exports.getBarOpt = __webpack_exports__.getBarOpt;
|
|
164
|
+
exports.getStackBarOpt = __webpack_exports__.getStackBarOpt;
|
|
165
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
166
|
+
"getBarOpt",
|
|
167
|
+
"getStackBarOpt"
|
|
168
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
169
|
+
Object.defineProperty(exports, '__esModule', {
|
|
170
|
+
value: true
|
|
171
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getEChartOptions: ()=>getEChartOptions
|
|
28
|
+
});
|
|
29
|
+
const index_cjs_namespaceObject = require("../types/index.cjs");
|
|
30
|
+
const external_getAreaSpec_cjs_namespaceObject = require("./getAreaSpec.cjs");
|
|
31
|
+
const external_getDualSpec_cjs_namespaceObject = require("./getDualSpec.cjs");
|
|
32
|
+
const external_getPieSpec_cjs_namespaceObject = require("./getPieSpec.cjs");
|
|
33
|
+
const external_getLineSpec_cjs_namespaceObject = require("./getLineSpec.cjs");
|
|
34
|
+
const external_getColumnSpec_cjs_namespaceObject = require("./getColumnSpec.cjs");
|
|
35
|
+
const external_getFunnelSpec_cjs_namespaceObject = require("./getFunnelSpec.cjs");
|
|
36
|
+
const external_getBarSpec_cjs_namespaceObject = require("./getBarSpec.cjs");
|
|
37
|
+
const external_tool_cjs_namespaceObject = require("./tool.cjs");
|
|
38
|
+
const external_getRadarSpec_cjs_namespaceObject = require("./getRadarSpec.cjs");
|
|
39
|
+
const getEChartOptions = (originWinChartProps)=>{
|
|
40
|
+
const winChartProps = (0, external_tool_cjs_namespaceObject.handleSort)(originWinChartProps);
|
|
41
|
+
switch(winChartProps.chartType){
|
|
42
|
+
case index_cjs_namespaceObject.WinChartType.MINI_AREA:
|
|
43
|
+
return (0, external_getAreaSpec_cjs_namespaceObject.getMiniAreaOpt)(winChartProps);
|
|
44
|
+
case index_cjs_namespaceObject.WinChartType.AREA:
|
|
45
|
+
return (0, external_getAreaSpec_cjs_namespaceObject.getAreaOpt)(winChartProps);
|
|
46
|
+
case index_cjs_namespaceObject.WinChartType.LINE:
|
|
47
|
+
return (0, external_getLineSpec_cjs_namespaceObject.getLineOpt)(winChartProps);
|
|
48
|
+
case index_cjs_namespaceObject.WinChartType.COLUMN:
|
|
49
|
+
return (0, external_getColumnSpec_cjs_namespaceObject.getColumnOpt)(winChartProps);
|
|
50
|
+
case index_cjs_namespaceObject.WinChartType.STACK_COLUMN:
|
|
51
|
+
return (0, external_getColumnSpec_cjs_namespaceObject.getColumnStackOpt)(winChartProps);
|
|
52
|
+
case index_cjs_namespaceObject.WinChartType.BAR:
|
|
53
|
+
return (0, external_getBarSpec_cjs_namespaceObject.getBarOpt)(winChartProps);
|
|
54
|
+
case index_cjs_namespaceObject.WinChartType.STACK_BAR:
|
|
55
|
+
return (0, external_getBarSpec_cjs_namespaceObject.getStackBarOpt)(winChartProps);
|
|
56
|
+
case index_cjs_namespaceObject.WinChartType.FUNNEL:
|
|
57
|
+
return (0, external_getFunnelSpec_cjs_namespaceObject.getFunnelOpt)(winChartProps);
|
|
58
|
+
case index_cjs_namespaceObject.WinChartType.DUAL_LINE_BAR:
|
|
59
|
+
return (0, external_getDualSpec_cjs_namespaceObject.getDualOpt)(winChartProps);
|
|
60
|
+
case index_cjs_namespaceObject.WinChartType.STACK_DUAL_LINE_BAR:
|
|
61
|
+
return (0, external_getDualSpec_cjs_namespaceObject.getStackDualOpt)(winChartProps);
|
|
62
|
+
case index_cjs_namespaceObject.WinChartType.PIE:
|
|
63
|
+
return (0, external_getPieSpec_cjs_namespaceObject.getPieOpt)(winChartProps);
|
|
64
|
+
case index_cjs_namespaceObject.WinChartType.CYCLE:
|
|
65
|
+
return (0, external_getPieSpec_cjs_namespaceObject.getPieCycleOpt)(winChartProps);
|
|
66
|
+
case index_cjs_namespaceObject.WinChartType.RADAR:
|
|
67
|
+
return (0, external_getRadarSpec_cjs_namespaceObject.getRadarOpt)(winChartProps);
|
|
68
|
+
default:
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.getEChartOptions = __webpack_exports__.getEChartOptions;
|
|
73
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
74
|
+
"getEChartOptions"
|
|
75
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
76
|
+
Object.defineProperty(exports, '__esModule', {
|
|
77
|
+
value: true
|
|
78
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getColumnOpt: ()=>getColumnOpt,
|
|
28
|
+
getColumnStackOpt: ()=>getColumnStackOpt
|
|
29
|
+
});
|
|
30
|
+
const external_tool_cjs_namespaceObject = require("./tool.cjs");
|
|
31
|
+
const getColumnOpt = (winChartProps)=>{
|
|
32
|
+
const barTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
33
|
+
return {
|
|
34
|
+
tooltip: {
|
|
35
|
+
trigger: 'axis',
|
|
36
|
+
axisPointer: {
|
|
37
|
+
type: 'cross',
|
|
38
|
+
label: {
|
|
39
|
+
backgroundColor: '#999'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
legend: {
|
|
44
|
+
bottom: 0,
|
|
45
|
+
type: 'scroll'
|
|
46
|
+
},
|
|
47
|
+
xAxis: {
|
|
48
|
+
...(0, external_tool_cjs_namespaceObject.getXAxisOpt)(winChartProps),
|
|
49
|
+
axisPointer: {
|
|
50
|
+
type: 'shadow'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
yAxis: {
|
|
54
|
+
min: winChartProps.yStart?.[0]
|
|
55
|
+
},
|
|
56
|
+
series: barTypeList.map((type)=>({
|
|
57
|
+
name: type,
|
|
58
|
+
type: 'bar',
|
|
59
|
+
barGap: '30%',
|
|
60
|
+
barCategoryGap: '30%',
|
|
61
|
+
barMaxWidth: 8,
|
|
62
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
63
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type).map((item)=>({
|
|
64
|
+
value: item,
|
|
65
|
+
itemStyle: {
|
|
66
|
+
borderRadius: item > 0 ? [
|
|
67
|
+
500,
|
|
68
|
+
500,
|
|
69
|
+
0,
|
|
70
|
+
0
|
|
71
|
+
] : [
|
|
72
|
+
0,
|
|
73
|
+
0,
|
|
74
|
+
500,
|
|
75
|
+
500
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}))
|
|
79
|
+
}))
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const getColumnStackOpt = (winChartProps)=>{
|
|
83
|
+
const barTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
84
|
+
return {
|
|
85
|
+
tooltip: {
|
|
86
|
+
trigger: 'axis',
|
|
87
|
+
axisPointer: {
|
|
88
|
+
type: 'cross',
|
|
89
|
+
label: {
|
|
90
|
+
backgroundColor: '#999'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
legend: {
|
|
95
|
+
bottom: 0,
|
|
96
|
+
type: 'scroll'
|
|
97
|
+
},
|
|
98
|
+
xAxis: {
|
|
99
|
+
...(0, external_tool_cjs_namespaceObject.getXAxisOpt)(winChartProps),
|
|
100
|
+
axisPointer: {
|
|
101
|
+
type: 'shadow'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
yAxis: {
|
|
105
|
+
min: winChartProps.yStart?.[0]
|
|
106
|
+
},
|
|
107
|
+
series: barTypeList.map((name)=>({
|
|
108
|
+
name,
|
|
109
|
+
type: 'bar',
|
|
110
|
+
stack: 'total',
|
|
111
|
+
barGap: '30%',
|
|
112
|
+
barCategoryGap: '30%',
|
|
113
|
+
barMaxWidth: 8,
|
|
114
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
115
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, name)
|
|
116
|
+
}))
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
exports.getColumnOpt = __webpack_exports__.getColumnOpt;
|
|
120
|
+
exports.getColumnStackOpt = __webpack_exports__.getColumnStackOpt;
|
|
121
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
122
|
+
"getColumnOpt",
|
|
123
|
+
"getColumnStackOpt"
|
|
124
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
125
|
+
Object.defineProperty(exports, '__esModule', {
|
|
126
|
+
value: true
|
|
127
|
+
});
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
getStackDualOpt: ()=>getStackDualOpt,
|
|
28
|
+
getDualOpt: ()=>getDualOpt
|
|
29
|
+
});
|
|
30
|
+
const external_tool_cjs_namespaceObject = require("./tool.cjs");
|
|
31
|
+
const getDualOpt = (winChartProps)=>{
|
|
32
|
+
const barTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
33
|
+
const lineTypeList = (0, external_tool_cjs_namespaceObject.getExtraDataTypes)(winChartProps);
|
|
34
|
+
return {
|
|
35
|
+
tooltip: {
|
|
36
|
+
trigger: 'axis',
|
|
37
|
+
axisPointer: {
|
|
38
|
+
type: 'cross',
|
|
39
|
+
crossStyle: {
|
|
40
|
+
color: '#999'
|
|
41
|
+
},
|
|
42
|
+
label: {
|
|
43
|
+
backgroundColor: '#999'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
legend: {
|
|
48
|
+
bottom: 0,
|
|
49
|
+
type: 'scroll'
|
|
50
|
+
},
|
|
51
|
+
xAxis: {
|
|
52
|
+
...(0, external_tool_cjs_namespaceObject.getXAxisOpt)(winChartProps),
|
|
53
|
+
axisPointer: {
|
|
54
|
+
type: 'shadow'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
yAxis: [
|
|
58
|
+
{
|
|
59
|
+
alignTicks: true,
|
|
60
|
+
min: winChartProps.yStart?.[0]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
alignTicks: true,
|
|
64
|
+
min: winChartProps.yStart?.[1]
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
series: [
|
|
68
|
+
...barTypeList.map((type)=>({
|
|
69
|
+
name: type,
|
|
70
|
+
type: 'bar',
|
|
71
|
+
barGap: '30%',
|
|
72
|
+
barCategoryGap: '30%',
|
|
73
|
+
barMaxWidth: 8,
|
|
74
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
75
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type).map((item)=>({
|
|
76
|
+
value: item,
|
|
77
|
+
itemStyle: {
|
|
78
|
+
borderRadius: item > 0 ? [
|
|
79
|
+
500,
|
|
80
|
+
500,
|
|
81
|
+
0,
|
|
82
|
+
0
|
|
83
|
+
] : [
|
|
84
|
+
0,
|
|
85
|
+
0,
|
|
86
|
+
500,
|
|
87
|
+
500
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}))
|
|
91
|
+
})),
|
|
92
|
+
...lineTypeList.map((type)=>({
|
|
93
|
+
name: type,
|
|
94
|
+
type: 'line',
|
|
95
|
+
smooth: true,
|
|
96
|
+
yAxisIndex: 1,
|
|
97
|
+
showSymbol: false,
|
|
98
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
99
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type)
|
|
100
|
+
}))
|
|
101
|
+
]
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const getStackDualOpt = (winChartProps)=>{
|
|
105
|
+
const barTypeList = (0, external_tool_cjs_namespaceObject.getDataTypes)(winChartProps);
|
|
106
|
+
const lineTypeList = (0, external_tool_cjs_namespaceObject.getExtraDataTypes)(winChartProps);
|
|
107
|
+
return {
|
|
108
|
+
tooltip: {
|
|
109
|
+
trigger: 'axis',
|
|
110
|
+
axisPointer: {
|
|
111
|
+
type: 'cross',
|
|
112
|
+
crossStyle: {
|
|
113
|
+
color: '#999'
|
|
114
|
+
},
|
|
115
|
+
label: {
|
|
116
|
+
backgroundColor: '#999'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
legend: {
|
|
121
|
+
bottom: 0,
|
|
122
|
+
type: 'scroll'
|
|
123
|
+
},
|
|
124
|
+
xAxis: {
|
|
125
|
+
...(0, external_tool_cjs_namespaceObject.getXAxisOpt)(winChartProps),
|
|
126
|
+
axisPointer: {
|
|
127
|
+
type: 'shadow'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
yAxis: [
|
|
131
|
+
{
|
|
132
|
+
alignTicks: true,
|
|
133
|
+
min: winChartProps.yStart?.[0]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
alignTicks: true,
|
|
137
|
+
min: winChartProps.yStart?.[1]
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
series: [
|
|
141
|
+
...barTypeList.map((type)=>({
|
|
142
|
+
name: type,
|
|
143
|
+
type: 'bar',
|
|
144
|
+
stack: 'total',
|
|
145
|
+
barGap: '30%',
|
|
146
|
+
barCategoryGap: '30%',
|
|
147
|
+
barMaxWidth: 8,
|
|
148
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
149
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type)
|
|
150
|
+
})),
|
|
151
|
+
...lineTypeList.map((type)=>({
|
|
152
|
+
name: type,
|
|
153
|
+
type: 'line',
|
|
154
|
+
smooth: true,
|
|
155
|
+
yAxisIndex: 1,
|
|
156
|
+
showSymbol: false,
|
|
157
|
+
label: (0, external_tool_cjs_namespaceObject.getSeriesLabelConfig)(winChartProps),
|
|
158
|
+
data: (0, external_tool_cjs_namespaceObject.getSeriesDataByType)(winChartProps, type)
|
|
159
|
+
}))
|
|
160
|
+
]
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
exports.getDualOpt = __webpack_exports__.getDualOpt;
|
|
164
|
+
exports.getStackDualOpt = __webpack_exports__.getStackDualOpt;
|
|
165
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
166
|
+
"getDualOpt",
|
|
167
|
+
"getStackDualOpt"
|
|
168
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
169
|
+
Object.defineProperty(exports, '__esModule', {
|
|
170
|
+
value: true
|
|
171
|
+
});
|