@cloudbase/weda-ui 3.1.0 → 3.1.3
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/dist/asset-manifest.json +17 -0
- package/dist/configs/actions/showModal.json +48 -0
- package/dist/configs/actions/showToast.json +41 -0
- package/dist/configs/components/auth.json +16 -0
- package/dist/configs/components/button.json +239 -0
- package/dist/configs/components/calendar.json +81 -0
- package/dist/configs/components/carousel.json +292 -0
- package/dist/configs/components/chart/bar.json +721 -0
- package/dist/configs/components/chart/line.json +674 -0
- package/dist/configs/components/chart/pie.json +494 -0
- package/dist/configs/components/chart/statisticsCard.json +376 -0
- package/dist/configs/components/container.json +50 -0
- package/dist/configs/components/dataView.json +239 -0
- package/dist/configs/components/drawer.json +115 -0
- package/dist/configs/components/form/checkbox.json +178 -0
- package/dist/configs/components/form/form.json +45 -0
- package/dist/configs/components/form/input.json +154 -0
- package/dist/configs/components/form/location.json +216 -0
- package/dist/configs/components/form/radio.json +203 -0
- package/dist/configs/components/form/richText.json +125 -0
- package/dist/configs/components/form/select.json +430 -0
- package/dist/configs/components/form/switch.json +58 -0
- package/dist/configs/components/form/textarea.json +116 -0
- package/dist/configs/components/form/tips.json +34 -0
- package/dist/configs/components/form/uploader.json +171 -0
- package/dist/configs/components/form/uploaderFile.json +158 -0
- package/dist/configs/components/graphicCard.json +413 -0
- package/dist/configs/components/image.json +187 -0
- package/dist/configs/components/link.json +79 -0
- package/dist/configs/components/listView.json +370 -0
- package/dist/configs/components/lottery.json +163 -0
- package/dist/configs/components/modal.json +72 -0
- package/dist/configs/components/navLayout.json +368 -0
- package/dist/configs/components/navigationBar.json +62 -0
- package/dist/configs/components/richtextview.json +26 -0
- package/dist/configs/components/scrollVeiw.json +253 -0
- package/dist/configs/components/slot.json +17 -0
- package/dist/configs/components/swiper.json +90 -0
- package/dist/configs/components/tabs.json +121 -0
- package/dist/configs/components/text.json +95 -0
- package/dist/configs/components/wedaVideo.json +89 -0
- package/dist/configs/components/wxOpenApi/phone.json +127 -0
- package/dist/configs/components/wxOpenApi/phoneCode.json +109 -0
- package/dist/configs/components/wxOpenApi/share.json +157 -0
- package/dist/configs/components/wxOpenApi/userInfo.json +156 -0
- package/dist/configs/index.d.ts +97 -0
- package/dist/configs/index.js +105 -0
- package/dist/docs/common/format.d.ts +13 -0
- package/dist/docs/common/format.js +103 -0
- package/dist/docs/common/tableView.d.ts +30 -0
- package/dist/docs/common/tableView.js +159 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.html +88 -0
- package/dist/index.js +3 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +14 -0
- package/dist/static/js/bundle.js +963 -0
- package/dist/static/js/bundle.js.map +1 -0
- package/dist/static/js/main.chunk.js +8841 -0
- package/dist/static/js/main.chunk.js.map +1 -0
- package/dist/static/js/vendors~main.chunk.js +247885 -0
- package/dist/static/js/vendors~main.chunk.js.map +1 -0
- package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +627 -0
- package/dist/web/actions/index.d.ts +2 -0
- package/dist/web/actions/index.js +2 -0
- package/dist/web/actions/showModal/index.d.ts +3 -0
- package/dist/web/actions/showModal/index.js +66 -0
- package/dist/web/actions/showToast/index.d.ts +1 -0
- package/dist/web/actions/showToast/index.js +3 -0
- package/dist/web/components/auth/index.d.ts +10 -0
- package/dist/web/components/auth/index.js +37 -0
- package/dist/web/components/button/index.css +27 -0
- package/dist/web/components/button/index.d.ts +32 -0
- package/dist/web/components/button/index.js +48 -0
- package/dist/web/components/calendar/index.css +416 -0
- package/dist/web/components/calendar/index.d.ts +19 -0
- package/dist/web/components/calendar/index.js +181 -0
- package/dist/web/components/calendar/util.d.ts +13 -0
- package/dist/web/components/calendar/util.js +74 -0
- package/dist/web/components/carousel/index.css +119 -0
- package/dist/web/components/carousel/index.d.ts +41 -0
- package/dist/web/components/carousel/index.js +240 -0
- package/dist/web/components/chart/bar/index.d.ts +41 -0
- package/dist/web/components/chart/bar/index.js +56 -0
- package/dist/web/components/chart/common/config/bar.d.ts +48 -0
- package/dist/web/components/chart/common/config/bar.js +49 -0
- package/dist/web/components/chart/common/config/global.d.ts +13 -0
- package/dist/web/components/chart/common/config/global.js +16 -0
- package/dist/web/components/chart/common/config/line.d.ts +46 -0
- package/dist/web/components/chart/common/config/line.js +49 -0
- package/dist/web/components/chart/common/config/pie.d.ts +29 -0
- package/dist/web/components/chart/common/config/pie.js +36 -0
- package/dist/web/components/chart/common/core/eChartBar.d.ts +68 -0
- package/dist/web/components/chart/common/core/eChartBar.js +196 -0
- package/dist/web/components/chart/common/core/eChartBase.d.ts +128 -0
- package/dist/web/components/chart/common/core/eChartBase.js +346 -0
- package/dist/web/components/chart/common/core/eChartLine.d.ts +62 -0
- package/dist/web/components/chart/common/core/eChartLine.js +168 -0
- package/dist/web/components/chart/common/core/eChartPie.d.ts +50 -0
- package/dist/web/components/chart/common/core/eChartPie.js +132 -0
- package/dist/web/components/chart/common/core/type.d.ts +35 -0
- package/dist/web/components/chart/common/core/type.js +9 -0
- package/dist/web/components/chart/common/echarts.d.ts +2 -0
- package/dist/web/components/chart/common/echarts.js +24 -0
- package/dist/web/components/chart/common/useChart.d.ts +8 -0
- package/dist/web/components/chart/common/useChart.js +60 -0
- package/dist/web/components/chart/line/index.d.ts +39 -0
- package/dist/web/components/chart/line/index.js +53 -0
- package/dist/web/components/chart/pie/index.d.ts +27 -0
- package/dist/web/components/chart/pie/index.js +40 -0
- package/dist/web/components/chart/statisticsCard/index.css +63 -0
- package/dist/web/components/chart/statisticsCard/index.d.ts +85 -0
- package/dist/web/components/chart/statisticsCard/index.js +203 -0
- package/dist/web/components/chart/statisticsCard/interface.d.ts +13 -0
- package/dist/web/components/chart/statisticsCard/interface.js +1 -0
- package/dist/web/components/container/index.d.ts +6 -0
- package/dist/web/components/container/index.js +6 -0
- package/dist/web/components/dataView/index.d.ts +6 -0
- package/dist/web/components/dataView/index.js +8 -0
- package/dist/web/components/dataView/interface.d.ts +5 -0
- package/dist/web/components/dataView/interface.js +1 -0
- package/dist/web/components/drawer/index.d.ts +13 -0
- package/dist/web/components/drawer/index.js +12 -0
- package/dist/web/components/form/checkbox/index.d.ts +13 -0
- package/dist/web/components/form/checkbox/index.js +167 -0
- package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
- package/dist/web/components/form/enumSelect/MultipleSelect.js +52 -0
- package/dist/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
- package/dist/web/components/form/enumSelect/NormalSelect.js +52 -0
- package/dist/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
- package/dist/web/components/form/enumSelect/SelectContainer.js +30 -0
- package/dist/web/components/form/enumSelect/index.d.ts +82 -0
- package/dist/web/components/form/enumSelect/index.js +6 -0
- package/dist/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
- package/dist/web/components/form/enumSelect/props/defaultProps.js +40 -0
- package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
- package/dist/web/components/form/enumSelect/props/propsTypes.js +47 -0
- package/dist/web/components/form/form/index.css +9 -0
- package/dist/web/components/form/form/index.d.ts +13 -0
- package/dist/web/components/form/form/index.js +31 -0
- package/dist/web/components/form/formcell/index.css +85 -0
- package/dist/web/components/form/formcell/index.d.ts +8 -0
- package/dist/web/components/form/formcell/index.js +40 -0
- package/dist/web/components/form/input/index.css +40 -0
- package/dist/web/components/form/input/index.d.ts +14 -0
- package/dist/web/components/form/input/index.js +86 -0
- package/dist/web/components/form/location/common/mapChoose.css +477 -0
- package/dist/web/components/form/location/common/mapChoose.d.ts +15 -0
- package/dist/web/components/form/location/common/mapChoose.js +435 -0
- package/dist/web/components/form/location/common/mapView.d.ts +19 -0
- package/dist/web/components/form/location/common/mapView.js +170 -0
- package/dist/web/components/form/location/common/propsConfig.d.ts +59 -0
- package/dist/web/components/form/location/common/propsConfig.js +50 -0
- package/dist/web/components/form/location/common/selectModal.css +45 -0
- package/dist/web/components/form/location/common/selectModal.d.ts +21 -0
- package/dist/web/components/form/location/common/selectModal.js +44 -0
- package/dist/web/components/form/location/common/useLocationInfo.d.ts +36 -0
- package/dist/web/components/form/location/common/useLocationInfo.js +104 -0
- package/dist/web/components/form/location/components/LocationH5/index.css +100 -0
- package/dist/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +323 -0
- package/dist/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
- package/dist/web/components/form/location/components/LocationPC/Header.js +43 -0
- package/dist/web/components/form/location/components/LocationPC/index.css +40 -0
- package/dist/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +224 -0
- package/dist/web/components/form/location/constants.d.ts +2 -0
- package/dist/web/components/form/location/constants.js +3 -0
- package/dist/web/components/form/location/index.css +13 -0
- package/dist/web/components/form/location/index.d.ts +1 -0
- package/dist/web/components/form/location/index.js +17 -0
- package/dist/web/components/form/radio/index.css +12 -0
- package/dist/web/components/form/radio/index.d.ts +11 -0
- package/dist/web/components/form/radio/index.js +115 -0
- package/dist/web/components/form/renderDecorator.d.ts +6 -0
- package/dist/web/components/form/renderDecorator.js +20 -0
- package/dist/web/components/form/select/h5.d.ts +16 -0
- package/dist/web/components/form/select/h5.js +504 -0
- package/dist/web/components/form/select/index.css +27 -0
- package/dist/web/components/form/select/index.d.ts +65 -0
- package/dist/web/components/form/select/index.js +301 -0
- package/dist/web/components/form/select/region/index.d.ts +6 -0
- package/dist/web/components/form/select/region/index.js +147 -0
- package/dist/web/components/form/select/time.d.ts +9 -0
- package/dist/web/components/form/select/time.js +146 -0
- package/dist/web/components/form/select/year.d.ts +7 -0
- package/dist/web/components/form/select/year.js +72 -0
- package/dist/web/components/form/switch/index.d.ts +6 -0
- package/dist/web/components/form/switch/index.js +57 -0
- package/dist/web/components/form/textarea/index.css +11 -0
- package/dist/web/components/form/textarea/index.d.ts +12 -0
- package/dist/web/components/form/textarea/index.js +66 -0
- package/dist/web/components/form/tips/index.css +4 -0
- package/dist/web/components/form/tips/index.d.ts +8 -0
- package/dist/web/components/form/tips/index.js +17 -0
- package/dist/web/components/form/uploader/index.css +118 -0
- package/dist/web/components/form/uploader/index.d.ts +3 -0
- package/dist/web/components/form/uploader/index.js +42 -0
- package/dist/web/components/form/uploader/uploader.h5.d.ts +19 -0
- package/dist/web/components/form/uploader/uploader.h5.js +201 -0
- package/dist/web/components/form/uploader/uploader.pc.d.ts +29 -0
- package/dist/web/components/form/uploader/uploader.pc.js +182 -0
- package/dist/web/components/form/uploaderFile/index.css +422 -0
- package/dist/web/components/form/uploaderFile/index.d.ts +4 -0
- package/dist/web/components/form/uploaderFile/index.js +19 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +315 -0
- package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +290 -0
- package/dist/web/components/graphicCard/index.css +159 -0
- package/dist/web/components/graphicCard/index.d.ts +31 -0
- package/dist/web/components/graphicCard/index.js +166 -0
- package/dist/web/components/image/image.d.ts +9 -0
- package/dist/web/components/image/image.js +119 -0
- package/dist/web/components/image/index.css +54 -0
- package/dist/web/components/image/index.d.ts +13 -0
- package/dist/web/components/image/index.js +91 -0
- package/dist/web/components/index.d.ts +47 -0
- package/dist/web/components/index.js +94 -0
- package/dist/web/components/link/index.css +8 -0
- package/dist/web/components/link/index.d.ts +24 -0
- package/dist/web/components/link/index.js +71 -0
- package/dist/web/components/listView/index.css +143 -0
- package/dist/web/components/listView/index.d.ts +7 -0
- package/dist/web/components/listView/index.js +262 -0
- package/dist/web/components/listView/interface.d.ts +122 -0
- package/dist/web/components/listView/interface.js +1 -0
- package/dist/web/components/lottery/index.css +359 -0
- package/dist/web/components/lottery/index.d.ts +22 -0
- package/dist/web/components/lottery/index.js +390 -0
- package/dist/web/components/lottery/lotteryUtil.d.ts +23 -0
- package/dist/web/components/lottery/lotteryUtil.js +180 -0
- package/dist/web/components/modal/h5.css +53 -0
- package/dist/web/components/modal/index.d.ts +17 -0
- package/dist/web/components/modal/index.js +11 -0
- package/dist/web/components/modal/modal.h5.d.ts +4 -0
- package/dist/web/components/modal/modal.h5.js +46 -0
- package/dist/web/components/modal/modal.pc.d.ts +3 -0
- package/dist/web/components/modal/modal.pc.js +31 -0
- package/dist/web/components/navLayout/index.css +332 -0
- package/dist/web/components/navLayout/index.d.ts +46 -0
- package/dist/web/components/navLayout/index.js +116 -0
- package/dist/web/components/navigationBar/common.d.ts +15 -0
- package/dist/web/components/navigationBar/common.js +127 -0
- package/dist/web/components/navigationBar/h5Menu.d.ts +14 -0
- package/dist/web/components/navigationBar/h5Menu.js +72 -0
- package/dist/web/components/navigationBar/horizontalMenu.d.ts +12 -0
- package/dist/web/components/navigationBar/horizontalMenu.js +99 -0
- package/dist/web/components/navigationBar/index.css +762 -0
- package/dist/web/components/navigationBar/index.d.ts +13 -0
- package/dist/web/components/navigationBar/index.js +157 -0
- package/dist/web/components/navigationBar/verticalMenu.d.ts +13 -0
- package/dist/web/components/navigationBar/verticalMenu.js +38 -0
- package/dist/web/components/phone/index.d.ts +18 -0
- package/dist/web/components/phone/index.js +4 -0
- package/dist/web/components/phoneCode/index.d.ts +18 -0
- package/dist/web/components/phoneCode/index.js +4 -0
- package/dist/web/components/picker/datePicker.d.ts +10 -0
- package/dist/web/components/picker/datePicker.js +31 -0
- package/dist/web/components/picker/picker.d.ts +6 -0
- package/dist/web/components/picker/picker.js +45 -0
- package/dist/web/components/picker/timePicker.d.ts +7 -0
- package/dist/web/components/picker/timePicker.js +42 -0
- package/dist/web/components/richText/const.d.ts +1 -0
- package/dist/web/components/richText/const.js +2 -0
- package/dist/web/components/richText/index.css +93 -0
- package/dist/web/components/richText/index.d.ts +51 -0
- package/dist/web/components/richText/index.js +298 -0
- package/dist/web/components/richTextView/index.css +63 -0
- package/dist/web/components/richTextView/index.d.ts +7 -0
- package/dist/web/components/richTextView/index.js +44 -0
- package/dist/web/components/scrollView/index.d.ts +27 -0
- package/dist/web/components/scrollView/index.js +95 -0
- package/dist/web/components/share/index.d.ts +34 -0
- package/dist/web/components/share/index.js +4 -0
- package/dist/web/components/slot/index.d.ts +6 -0
- package/dist/web/components/slot/index.js +9 -0
- package/dist/web/components/swiper/index.css +106 -0
- package/dist/web/components/swiper/index.d.ts +24 -0
- package/dist/web/components/swiper/index.js +149 -0
- package/dist/web/components/tabs/index.css +64 -0
- package/dist/web/components/tabs/index.d.ts +13 -0
- package/dist/web/components/tabs/index.js +15 -0
- package/dist/web/components/tabs/tabs.h5.d.ts +4 -0
- package/dist/web/components/tabs/tabs.h5.js +42 -0
- package/dist/web/components/tabs/tabs.pc.d.ts +3 -0
- package/dist/web/components/tabs/tabs.pc.js +40 -0
- package/dist/web/components/text/index.css +26 -0
- package/dist/web/components/text/index.d.ts +14 -0
- package/dist/web/components/text/index.js +17 -0
- package/dist/web/components/uploaderFileView/index.css +11 -0
- package/dist/web/components/uploaderFileView/index.d.ts +10 -0
- package/dist/web/components/uploaderFileView/index.js +61 -0
- package/dist/web/components/uploaderView/index.css +31 -0
- package/dist/web/components/uploaderView/index.d.ts +17 -0
- package/dist/web/components/uploaderView/index.js +48 -0
- package/dist/web/components/userInfo/index.d.ts +26 -0
- package/dist/web/components/userInfo/index.js +4 -0
- package/dist/web/components/wedaVideo/index.css +42 -0
- package/dist/web/components/wedaVideo/index.d.ts +17 -0
- package/dist/web/components/wedaVideo/index.js +159 -0
- package/dist/web/index.d.ts +8 -0
- package/dist/web/index.js +4 -0
- package/dist/web/utils/classnames.d.ts +2 -0
- package/dist/web/utils/classnames.js +37 -0
- package/dist/web/utils/constant.d.ts +23 -0
- package/dist/web/utils/constant.js +24 -0
- package/dist/web/utils/debounce.d.ts +2 -0
- package/dist/web/utils/debounce.js +92 -0
- package/dist/web/utils/events.d.ts +1 -0
- package/dist/web/utils/events.js +2 -0
- package/dist/web/utils/getLocalCounter.d.ts +1 -0
- package/dist/web/utils/getLocalCounter.js +4 -0
- package/dist/web/utils/isObjectEqual.d.ts +2 -0
- package/dist/web/utils/isObjectEqual.js +12 -0
- package/dist/web/utils/loading-fallback.d.ts +2 -0
- package/dist/web/utils/loading-fallback.js +2 -0
- package/dist/web/utils/lodash.d.ts +1 -0
- package/dist/web/utils/lodash.js +2 -0
- package/dist/web/utils/platform.d.ts +18 -0
- package/dist/web/utils/platform.js +191 -0
- package/dist/web/utils/tcb.d.ts +23 -0
- package/dist/web/utils/tcb.js +82 -0
- package/dist/web/utils/tmap.d.ts +3 -0
- package/dist/web/utils/tmap.js +21 -0
- package/dist/web/utils/useSetState.d.ts +1 -0
- package/dist/web/utils/useSetState.js +8 -0
- package/dist/web/utils/useSyncValue.d.ts +4 -0
- package/dist/web/utils/useSyncValue.js +15 -0
- package/dist/web/utils/weui.d.ts +1 -0
- package/dist/web/utils/weui.js +2 -0
- package/dist/web/weda-ui.css +90 -0
- package/package.json +12 -12
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import EchartBase from './eChartBase';
|
|
2
|
+
import getConfig from '../config/line';
|
|
3
|
+
/**
|
|
4
|
+
* 折线图表
|
|
5
|
+
* @author loonglong
|
|
6
|
+
**/
|
|
7
|
+
class EchartLine extends EchartBase {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const config = getConfig();
|
|
11
|
+
this.config = { ...this.config, ...config };
|
|
12
|
+
}
|
|
13
|
+
async setSourceData({ dataSource, filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, }) {
|
|
14
|
+
const { name = '', type = '', methodName = '' } = dataSource;
|
|
15
|
+
if (name !== '') {
|
|
16
|
+
const params = this.createWhere({
|
|
17
|
+
filterData,
|
|
18
|
+
xField,
|
|
19
|
+
xStatistics,
|
|
20
|
+
xIsCountEmpty,
|
|
21
|
+
yField,
|
|
22
|
+
groupKey,
|
|
23
|
+
groupKeyTimeSpan,
|
|
24
|
+
});
|
|
25
|
+
const arrSourData = await this.getSourceData(name, methodName, type, params);
|
|
26
|
+
// 获取 x 轴数据
|
|
27
|
+
const sortedXAxisData = this.sortXAxisData(arrSourData, xField.format);
|
|
28
|
+
const arrXaxisData = this.setXaxis(sortedXAxisData, xField.format);
|
|
29
|
+
const arrXisCountEmptyIndex = []; // 记录空值的key
|
|
30
|
+
if (Object.keys(groupKey !== null && groupKey !== void 0 ? groupKey : {}).length === 0) {
|
|
31
|
+
const numLine = sortedXAxisData[0].YLabels.length;
|
|
32
|
+
if (numLine > 0) {
|
|
33
|
+
for (let j = 0; j < numLine; j++) {
|
|
34
|
+
this.config.series[j] = {
|
|
35
|
+
type: 'line',
|
|
36
|
+
smooth: true,
|
|
37
|
+
name: '',
|
|
38
|
+
connectNulls: true,
|
|
39
|
+
showSymbol: true,
|
|
40
|
+
label: {
|
|
41
|
+
show: true,
|
|
42
|
+
},
|
|
43
|
+
data: [],
|
|
44
|
+
};
|
|
45
|
+
sortedXAxisData.forEach((itemSource, index) => {
|
|
46
|
+
this.config.series[j].name = itemSource.YLabels[j].Cn_Name;
|
|
47
|
+
if ((itemSource.YLabels[j].Value === undefined ||
|
|
48
|
+
itemSource.YLabels[j].Value === null) &&
|
|
49
|
+
!xIsCountEmpty) {
|
|
50
|
+
arrXisCountEmptyIndex.push(index);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const value = itemSource.YLabels[j].Value
|
|
54
|
+
? itemSource.YLabels[j].Value
|
|
55
|
+
: 0;
|
|
56
|
+
this.config.series[j].data.push(value);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// 处理显示空值问题
|
|
62
|
+
this.setEmptyValue(xIsCountEmpty);
|
|
63
|
+
}
|
|
64
|
+
else if (groupKey) {
|
|
65
|
+
// 如果是分组,则这里需要特殊处理
|
|
66
|
+
// 按groupKey分组存放数据值
|
|
67
|
+
const objGroupKey = {}; // {'分组字段':[{value:'统计的值', dimensionality:'维度名', name:'统计的数值字段名'}]}
|
|
68
|
+
sortedXAxisData.forEach((itemSourData) => {
|
|
69
|
+
itemSourData.YLabels.forEach((yLabel) => {
|
|
70
|
+
if (!objGroupKey[yLabel.Group_Name]) {
|
|
71
|
+
objGroupKey[yLabel.Group_Name] = [];
|
|
72
|
+
}
|
|
73
|
+
objGroupKey[yLabel.Group_Name].push({
|
|
74
|
+
value: yLabel.Value,
|
|
75
|
+
dimensionality: itemSourData.XLabel.Value,
|
|
76
|
+
name: yLabel.Cn_Name,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
// 组装图表需要的数据
|
|
81
|
+
const groupNames = Object.keys(objGroupKey);
|
|
82
|
+
this.config.series = groupNames.map((groupKey) => {
|
|
83
|
+
// groupKey分组字段中文名
|
|
84
|
+
const serie = {
|
|
85
|
+
name: groupKey,
|
|
86
|
+
connectNulls: true,
|
|
87
|
+
data: this.getSeriesDataGroup(arrXaxisData, objGroupKey[groupKey]),
|
|
88
|
+
type: 'line',
|
|
89
|
+
smooth: true,
|
|
90
|
+
showSymbol: true,
|
|
91
|
+
label: {
|
|
92
|
+
show: true, // 显示线条上的数据
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
return serie;
|
|
96
|
+
});
|
|
97
|
+
this.config.tooltip.formatter = (params) => `${params.data.dimensionality}\r\n${params.data.name}\r\n${params.seriesName}:${params.value}`;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
setChartType({ chartType }) {
|
|
102
|
+
this.config.series.length > 0 &&
|
|
103
|
+
this.config.series.forEach((itemSeries) => {
|
|
104
|
+
itemSeries.smooth = chartType !== 'line';
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// 显示图表上的数据标签 单位,标签,小数位数,后缀
|
|
108
|
+
setIsSeriesShowSymbol({ isSeriesShowSymbol, isUnit, unit, decimalDigits, suffix, }) {
|
|
109
|
+
decimalDigits = decimalDigits < 0 ? 0 : decimalDigits;
|
|
110
|
+
this.config.series.length > 0 &&
|
|
111
|
+
this.config.series.forEach((itemSeries) => {
|
|
112
|
+
itemSeries.showSymbol = isSeriesShowSymbol;
|
|
113
|
+
itemSeries.label.show = isSeriesShowSymbol;
|
|
114
|
+
if (isUnit) {
|
|
115
|
+
itemSeries.label.formatter = (params) => {
|
|
116
|
+
const objNewValue = this.getValueByUnit(params.value, unit);
|
|
117
|
+
return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
if (isUnit) {
|
|
122
|
+
this.config.yAxis.axisLabel.formatter = (value) => {
|
|
123
|
+
const objNewValue = this.getValueByUnit(value, unit);
|
|
124
|
+
return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.config.yAxis.axisLabel.formatter = null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
|
|
132
|
+
if (dataSource) {
|
|
133
|
+
await this.setSourceData({
|
|
134
|
+
dataSource,
|
|
135
|
+
filterData,
|
|
136
|
+
xField,
|
|
137
|
+
xStatistics,
|
|
138
|
+
xIsCountEmpty,
|
|
139
|
+
yField,
|
|
140
|
+
groupKey,
|
|
141
|
+
groupKeyTimeSpan,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
legend = document.body.clientWidth < 1024 ? legend : legend2;
|
|
145
|
+
this.setChartType({ chartType });
|
|
146
|
+
this.setTitle({ isTitle, title, titleLocation });
|
|
147
|
+
this.setLegend({ isLegend, legend });
|
|
148
|
+
this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
|
|
149
|
+
this.setIsXaxisName({ isXaxisName, xAxisName });
|
|
150
|
+
this.setIsXaxisAxisTickShow({ isXaxisAxisTickShow });
|
|
151
|
+
this.setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics });
|
|
152
|
+
this.setIsYAxisSplitlineLinestyleWidth({
|
|
153
|
+
isYAxisSplitlineLinestyleWidth,
|
|
154
|
+
yAxisSplitlineLinestyleType,
|
|
155
|
+
});
|
|
156
|
+
this.setYAxisMaxMin({ yAxisMax, yAxisMin });
|
|
157
|
+
this.setIsYAxisName({ isYAxisName, yAxisName });
|
|
158
|
+
this.setIsYAxisShow({ isYAxisShow });
|
|
159
|
+
this.setIsSeriesShowSymbol({
|
|
160
|
+
isSeriesShowSymbol,
|
|
161
|
+
isUnit,
|
|
162
|
+
unit,
|
|
163
|
+
decimalDigits,
|
|
164
|
+
suffix,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
export default EchartLine;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export default EchartPie;
|
|
2
|
+
/**
|
|
3
|
+
* 饼状图表
|
|
4
|
+
* @author loonglong
|
|
5
|
+
**/
|
|
6
|
+
declare class EchartPie extends EchartBase {
|
|
7
|
+
setSourceData({ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, }: {
|
|
8
|
+
dataSource: any;
|
|
9
|
+
filterData: any;
|
|
10
|
+
setColor: any;
|
|
11
|
+
xField: any;
|
|
12
|
+
xStatistics: any;
|
|
13
|
+
xIsCountEmpty: any;
|
|
14
|
+
yField: any;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
setChartType({ chartType }: {
|
|
17
|
+
chartType: any;
|
|
18
|
+
}): void;
|
|
19
|
+
setIsSeriesShowSymbol({ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
|
|
20
|
+
isSeriesShowSymbol: any;
|
|
21
|
+
isPercent: any;
|
|
22
|
+
isUnit: any;
|
|
23
|
+
unit: any;
|
|
24
|
+
decimalDigits: any;
|
|
25
|
+
suffix: any;
|
|
26
|
+
}): void;
|
|
27
|
+
setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
|
|
28
|
+
chartType: any;
|
|
29
|
+
isTitle: any;
|
|
30
|
+
title: any;
|
|
31
|
+
titleLocation: any;
|
|
32
|
+
dataSource: any;
|
|
33
|
+
filterData: any;
|
|
34
|
+
setColor: any;
|
|
35
|
+
xField: any;
|
|
36
|
+
xStatistics: any;
|
|
37
|
+
xIsCountEmpty: any;
|
|
38
|
+
yField: any;
|
|
39
|
+
isLegend: any;
|
|
40
|
+
legend: any;
|
|
41
|
+
legend2: any;
|
|
42
|
+
isSeriesShowSymbol: any;
|
|
43
|
+
isPercent: any;
|
|
44
|
+
isUnit: any;
|
|
45
|
+
unit: any;
|
|
46
|
+
decimalDigits: any;
|
|
47
|
+
suffix: any;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
import EchartBase from "./eChartBase";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import EchartBase from './eChartBase';
|
|
2
|
+
import getConfig from '../config/pie';
|
|
3
|
+
/**
|
|
4
|
+
* 饼状图表
|
|
5
|
+
* @author loonglong
|
|
6
|
+
**/
|
|
7
|
+
class EchartPie extends EchartBase {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const config = getConfig();
|
|
11
|
+
this.config = { ...this.config, ...config };
|
|
12
|
+
}
|
|
13
|
+
async setSourceData({ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, }) {
|
|
14
|
+
const { name = '', type = '', methodName = '' } = dataSource;
|
|
15
|
+
if (name !== '') {
|
|
16
|
+
const params = this.createWhere({
|
|
17
|
+
filterData,
|
|
18
|
+
xField,
|
|
19
|
+
xStatistics,
|
|
20
|
+
xIsCountEmpty,
|
|
21
|
+
yField,
|
|
22
|
+
});
|
|
23
|
+
const arrSourData = await this.getSourceData(name, methodName, type, params);
|
|
24
|
+
// 获取 x 轴数据
|
|
25
|
+
if (arrSourData.length > 0) {
|
|
26
|
+
const numPie = arrSourData[0].YLabels.length;
|
|
27
|
+
if (numPie > 0) {
|
|
28
|
+
const arrData = [];
|
|
29
|
+
let i = 0;
|
|
30
|
+
arrSourData.forEach((itemSource) => {
|
|
31
|
+
const numc = setColor ? setColor.length : 0;
|
|
32
|
+
const strColor = numc > 0 ? { color: setColor[i % numc] } : {};
|
|
33
|
+
arrData.push({
|
|
34
|
+
value: itemSource.YLabels[0].Value,
|
|
35
|
+
name: itemSource.XLabel.Value,
|
|
36
|
+
tooltip: {},
|
|
37
|
+
itemStyle: strColor,
|
|
38
|
+
});
|
|
39
|
+
i = i + 1;
|
|
40
|
+
});
|
|
41
|
+
this.config.series[0].data = arrData;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// this.config['series'][0].data = [];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
setChartType({ chartType }) {
|
|
50
|
+
this.config.series.length > 0 &&
|
|
51
|
+
this.config.series.forEach((itemSeries) => {
|
|
52
|
+
if (chartType === 'pie') {
|
|
53
|
+
itemSeries.radius = '70%';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// @ts-ignore no type
|
|
57
|
+
itemSeries.radius = ['40%', '70%'];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// 显示图表上的数据标签 单位,标签,小数位数,后缀
|
|
62
|
+
setIsSeriesShowSymbol({ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
63
|
+
decimalDigits = decimalDigits < 0 ? 0 : decimalDigits;
|
|
64
|
+
let show = false;
|
|
65
|
+
let position = 'inner';
|
|
66
|
+
let formatter = null;
|
|
67
|
+
if (isSeriesShowSymbol || isPercent || isUnit) {
|
|
68
|
+
formatter = '';
|
|
69
|
+
}
|
|
70
|
+
this.config.series[0].label.show = show;
|
|
71
|
+
this.config.series[0].label.position = position;
|
|
72
|
+
if (formatter === null) {
|
|
73
|
+
this.config.series[0].label.normal = null;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.config.series[0].label.normal.formatter = (objValue) => {
|
|
77
|
+
let reData = '';
|
|
78
|
+
if (isSeriesShowSymbol) {
|
|
79
|
+
// 显示数值
|
|
80
|
+
reData = objValue.value;
|
|
81
|
+
}
|
|
82
|
+
if (isUnit) {
|
|
83
|
+
// 显示单位
|
|
84
|
+
if (unit) {
|
|
85
|
+
const objNewValue = this.getValueByUnit(objValue.value, unit);
|
|
86
|
+
reData = `${objNewValue.toFixed(decimalDigits)}${suffix}`;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
reData = `${objValue.value.toFixed(decimalDigits)}`;
|
|
90
|
+
}
|
|
91
|
+
this.config.series[0].data.forEach((itemData) => {
|
|
92
|
+
itemData.tooltip.formatter = (objVal) => {
|
|
93
|
+
const objItemData = this.getValueByUnit(objVal.value, unit);
|
|
94
|
+
return `${objItemData.toFixed(decimalDigits)}${suffix}`;
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (isPercent) {
|
|
99
|
+
// 显示百分比
|
|
100
|
+
reData = `${reData}(${objValue.percent}%)`;
|
|
101
|
+
}
|
|
102
|
+
return reData;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
107
|
+
legend = document.body.clientWidth < 1024 ? legend : legend2;
|
|
108
|
+
if (dataSource) {
|
|
109
|
+
await this.setSourceData({
|
|
110
|
+
dataSource,
|
|
111
|
+
filterData,
|
|
112
|
+
setColor,
|
|
113
|
+
xField,
|
|
114
|
+
xStatistics,
|
|
115
|
+
xIsCountEmpty,
|
|
116
|
+
yField,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
this.setChartType({ chartType });
|
|
120
|
+
this.setTitle({ isTitle, title, titleLocation });
|
|
121
|
+
this.setLegend({ isLegend, legend });
|
|
122
|
+
this.setIsSeriesShowSymbol({
|
|
123
|
+
isSeriesShowSymbol,
|
|
124
|
+
isPercent,
|
|
125
|
+
isUnit,
|
|
126
|
+
unit,
|
|
127
|
+
decimalDigits,
|
|
128
|
+
suffix,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export default EchartPie;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface DataSource {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
subType: string;
|
|
5
|
+
provider?: string;
|
|
6
|
+
methodName: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ObjSource {
|
|
9
|
+
dataSourceName: string;
|
|
10
|
+
dataSourceType: string;
|
|
11
|
+
dataSourceMethodName: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Xfield {
|
|
14
|
+
format: string;
|
|
15
|
+
type: string;
|
|
16
|
+
title: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
declare enum CountType {
|
|
20
|
+
'count' = 0,
|
|
21
|
+
'sum' = 1,
|
|
22
|
+
'avg' = 2,
|
|
23
|
+
'max' = 3,
|
|
24
|
+
'min' = 4
|
|
25
|
+
}
|
|
26
|
+
export interface YfieldOne {
|
|
27
|
+
key: string;
|
|
28
|
+
operationType: CountType;
|
|
29
|
+
title?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Yfield {
|
|
32
|
+
groupKey?: string;
|
|
33
|
+
numValue?: Array<YfieldOne>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var CountType;
|
|
2
|
+
(function (CountType) {
|
|
3
|
+
CountType[CountType["count"] = 0] = "count";
|
|
4
|
+
CountType[CountType["sum"] = 1] = "sum";
|
|
5
|
+
CountType[CountType["avg"] = 2] = "avg";
|
|
6
|
+
CountType[CountType["max"] = 3] = "max";
|
|
7
|
+
CountType[CountType["min"] = 4] = "min";
|
|
8
|
+
})(CountType || (CountType = {}));
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
|
|
2
|
+
import * as echarts from 'echarts/core';
|
|
3
|
+
// 引入图表,图表后缀都为 Chart
|
|
4
|
+
import { BarChart, LineChart, PieChart } from 'echarts/charts';
|
|
5
|
+
//组件,组件后缀都为 Component
|
|
6
|
+
import { TitleComponent, TooltipComponent, LegendComponent, GridComponent, } from 'echarts/components';
|
|
7
|
+
// 标签自动布局,全局过渡动画等特性
|
|
8
|
+
import { LabelLayout, UniversalTransition } from 'echarts/features';
|
|
9
|
+
// 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
|
|
10
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
11
|
+
// 注册必须的组件
|
|
12
|
+
echarts.use([
|
|
13
|
+
TitleComponent,
|
|
14
|
+
TooltipComponent,
|
|
15
|
+
GridComponent,
|
|
16
|
+
LegendComponent,
|
|
17
|
+
LabelLayout,
|
|
18
|
+
UniversalTransition,
|
|
19
|
+
CanvasRenderer,
|
|
20
|
+
BarChart,
|
|
21
|
+
LineChart,
|
|
22
|
+
PieChart,
|
|
23
|
+
]);
|
|
24
|
+
export default echarts;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MutableRefObject, RefObject } from 'react';
|
|
2
|
+
import { IEchartModalBase } from './core/eChartBase';
|
|
3
|
+
import type IEcharts from './echarts';
|
|
4
|
+
export declare function useChart(ref: RefObject<HTMLElement> | MutableRefObject<HTMLElement>): IEcharts.ECharts;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The method should not be used
|
|
7
|
+
*/
|
|
8
|
+
export declare function useWedaChart(domRef: any, ModalClass: IEchartModalBase, options: IEcharts.EChartsCoreOption): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, } from '@react-hookz/web';
|
|
2
|
+
import { useEffect, useRef, } from 'react';
|
|
3
|
+
export function useChart(ref) {
|
|
4
|
+
const chartRef = useRef();
|
|
5
|
+
const isMounted = useIsMounted();
|
|
6
|
+
useMountEffect(async () => {
|
|
7
|
+
if (!ref.current || !isMounted) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const echarts = (await import(/* webpackChunkName: "echarts" */ './echarts')).default;
|
|
11
|
+
const echartDom = ref.current;
|
|
12
|
+
const chart = echarts.init(echartDom);
|
|
13
|
+
chartRef.current = chart;
|
|
14
|
+
return () => {
|
|
15
|
+
chart.dispose();
|
|
16
|
+
chartRef.current = null;
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
useEventListener(window, 'resize', () => {
|
|
20
|
+
chartRef.current && chartRef.current.resize();
|
|
21
|
+
});
|
|
22
|
+
return chartRef.current;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated The method should not be used
|
|
26
|
+
*/
|
|
27
|
+
export function useWedaChart(domRef, ModalClass, options) {
|
|
28
|
+
const chart = useChart(domRef);
|
|
29
|
+
const getOptions = async () => {
|
|
30
|
+
const chartModal = new ModalClass();
|
|
31
|
+
let finalOptions = await chartModal.setOptions(options);
|
|
32
|
+
if (!finalOptions) {
|
|
33
|
+
finalOptions = chartModal.getOptions();
|
|
34
|
+
}
|
|
35
|
+
return finalOptions;
|
|
36
|
+
};
|
|
37
|
+
const [state, actions] = useAsync(getOptions);
|
|
38
|
+
useMountEffect(() => {
|
|
39
|
+
actions.execute();
|
|
40
|
+
});
|
|
41
|
+
useDeepCompareEffect(() => {
|
|
42
|
+
actions.execute();
|
|
43
|
+
}, [
|
|
44
|
+
// options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
|
|
45
|
+
options,
|
|
46
|
+
actions,
|
|
47
|
+
]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (state.status === 'success' && chart) {
|
|
50
|
+
console.log(ModalClass.name, options, state.result, window.location.href);
|
|
51
|
+
chart.setOption(state.result, true // noMerge 全刷
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
if (state.status === 'error') {
|
|
56
|
+
console.error(state.error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, [state]);
|
|
60
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType } from '../../../types';
|
|
3
|
+
import { DataSource, Xfield, Yfield } from '../common/core/type';
|
|
4
|
+
interface PropsType extends Omit<CommonPropsType, 'children'> {
|
|
5
|
+
chartType?: string;
|
|
6
|
+
isTitle?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
titleLocation?: string;
|
|
9
|
+
dataSource?: DataSource;
|
|
10
|
+
filterData?: string;
|
|
11
|
+
xField?: Xfield;
|
|
12
|
+
groupKey?: Xfield;
|
|
13
|
+
groupKeyTimeSpan?: string;
|
|
14
|
+
xStatistics?: string;
|
|
15
|
+
xIsCountEmpty?: boolean;
|
|
16
|
+
yField?: Yfield;
|
|
17
|
+
isLegend?: boolean;
|
|
18
|
+
legend?: string;
|
|
19
|
+
legend2?: string;
|
|
20
|
+
isXaxisName?: boolean;
|
|
21
|
+
xAxisName?: string;
|
|
22
|
+
isXaxisAxisLabelShow?: boolean;
|
|
23
|
+
isXaxisAxisTickShow?: boolean;
|
|
24
|
+
isXaxisAxisLabelRotate?: boolean;
|
|
25
|
+
isYAxisSplitlineLinestyleWidth?: boolean;
|
|
26
|
+
yAxisSplitlineLinestyleType?: string;
|
|
27
|
+
yAxisMax?: number;
|
|
28
|
+
yAxisMin?: number;
|
|
29
|
+
isYAxisName?: boolean;
|
|
30
|
+
yAxisName?: string;
|
|
31
|
+
isSeriesShowSymbol?: boolean;
|
|
32
|
+
isYAxisShow?: boolean;
|
|
33
|
+
isUnit?: boolean;
|
|
34
|
+
unit?: string;
|
|
35
|
+
decimalDigits?: number;
|
|
36
|
+
suffix?: string;
|
|
37
|
+
}
|
|
38
|
+
export default function Line(opts: PropsType): JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import EChartLine from '../common/core/eChartLine';
|
|
3
|
+
import classNames from '../../../utils/classnames';
|
|
4
|
+
import { useWedaChart } from '../common/useChart';
|
|
5
|
+
export default function Line(opts) {
|
|
6
|
+
const { id, style, className, chartType, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, } = opts;
|
|
7
|
+
const domRef = useRef();
|
|
8
|
+
useWedaChart(domRef, EChartLine, {
|
|
9
|
+
chartType,
|
|
10
|
+
isTitle,
|
|
11
|
+
title,
|
|
12
|
+
titleLocation,
|
|
13
|
+
dataSource,
|
|
14
|
+
filterData,
|
|
15
|
+
xField,
|
|
16
|
+
xStatistics,
|
|
17
|
+
xIsCountEmpty,
|
|
18
|
+
yField,
|
|
19
|
+
groupKey,
|
|
20
|
+
groupKeyTimeSpan,
|
|
21
|
+
isLegend,
|
|
22
|
+
legend,
|
|
23
|
+
legend2,
|
|
24
|
+
isXaxisName,
|
|
25
|
+
xAxisName,
|
|
26
|
+
isXaxisAxisLabelShow,
|
|
27
|
+
isXaxisAxisTickShow,
|
|
28
|
+
isXaxisAxisLabelRotate,
|
|
29
|
+
isYAxisSplitlineLinestyleWidth,
|
|
30
|
+
yAxisSplitlineLinestyleType,
|
|
31
|
+
yAxisMax,
|
|
32
|
+
yAxisMin,
|
|
33
|
+
isYAxisName,
|
|
34
|
+
yAxisName,
|
|
35
|
+
isSeriesShowSymbol,
|
|
36
|
+
isYAxisShow,
|
|
37
|
+
isUnit,
|
|
38
|
+
unit,
|
|
39
|
+
decimalDigits,
|
|
40
|
+
suffix,
|
|
41
|
+
});
|
|
42
|
+
const inlineStyle = {
|
|
43
|
+
height: '380px',
|
|
44
|
+
width: '100%',
|
|
45
|
+
backgroundColor: '#ffffff',
|
|
46
|
+
...style,
|
|
47
|
+
};
|
|
48
|
+
return (React.createElement("div", { id: id, ref: domRef, "data-testid": "line", style: inlineStyle, className: classNames({
|
|
49
|
+
'echart-wrapper-canvas': true,
|
|
50
|
+
'echart-dark-body': true,
|
|
51
|
+
[className]: className,
|
|
52
|
+
}) }));
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType } from '../../../types';
|
|
3
|
+
import { DataSource, Xfield, Yfield } from '../common/core/type';
|
|
4
|
+
interface PropsType extends Omit<CommonPropsType, 'children'> {
|
|
5
|
+
chartType?: string;
|
|
6
|
+
isTitle?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
titleLocation?: string;
|
|
9
|
+
dataSource?: DataSource;
|
|
10
|
+
filterData?: string;
|
|
11
|
+
setColor?: Array<string>;
|
|
12
|
+
xField?: Xfield;
|
|
13
|
+
xStatistics?: string;
|
|
14
|
+
xIsCountEmpty?: boolean;
|
|
15
|
+
yField?: Yfield;
|
|
16
|
+
isLegend?: boolean;
|
|
17
|
+
legend?: string;
|
|
18
|
+
legend2?: string;
|
|
19
|
+
isSeriesShowSymbol?: boolean;
|
|
20
|
+
isPercent?: boolean;
|
|
21
|
+
isUnit?: boolean;
|
|
22
|
+
unit?: string;
|
|
23
|
+
decimalDigits?: number;
|
|
24
|
+
suffix?: string;
|
|
25
|
+
}
|
|
26
|
+
export default function Line({ id, style, className, chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: PropsType): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import EchartPie from '../common/core/eChartPie';
|
|
3
|
+
import { useWedaChart } from '../common/useChart';
|
|
4
|
+
import classNames from '../../../utils/classnames';
|
|
5
|
+
export default function Line({ id, style, className, chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
6
|
+
const domRef = useRef();
|
|
7
|
+
useWedaChart(domRef, EchartPie, {
|
|
8
|
+
chartType,
|
|
9
|
+
isTitle,
|
|
10
|
+
title,
|
|
11
|
+
titleLocation,
|
|
12
|
+
dataSource,
|
|
13
|
+
filterData,
|
|
14
|
+
setColor,
|
|
15
|
+
xField,
|
|
16
|
+
xStatistics,
|
|
17
|
+
xIsCountEmpty,
|
|
18
|
+
yField,
|
|
19
|
+
isLegend,
|
|
20
|
+
legend,
|
|
21
|
+
legend2,
|
|
22
|
+
isSeriesShowSymbol,
|
|
23
|
+
isPercent,
|
|
24
|
+
isUnit,
|
|
25
|
+
unit,
|
|
26
|
+
decimalDigits,
|
|
27
|
+
suffix,
|
|
28
|
+
});
|
|
29
|
+
const inlineStyle = {
|
|
30
|
+
height: '380px',
|
|
31
|
+
width: '100%',
|
|
32
|
+
backgroundColor: '#ffffff',
|
|
33
|
+
...style,
|
|
34
|
+
};
|
|
35
|
+
return (React.createElement("div", { id: id, "data-testid": "pie", ref: domRef, style: inlineStyle, className: classNames({
|
|
36
|
+
'echart-wrapper-canvas': true,
|
|
37
|
+
'echart-dark-body': true,
|
|
38
|
+
[className]: className,
|
|
39
|
+
}) }));
|
|
40
|
+
}
|