UNPKG

@dfsj/echarts

Version:

专业的水文曲线组件或构造函数以及通用的echart二次封装图表

44 lines (41 loc) 1.29 kB
/** * * @dfsj/echarts: 专业的水文曲线组件或构造函数以及通用的echart二次封装图表 * 版本: v3.7.0-alpha.5 * 作者:yangbo <1747837358@qq.com> * 日期:2025-11-21 13:30:34 * * */ import * as echarts from 'echarts'; import Factory from './factory.js'; echarts.extendChartView({ type: 'mark', render: function render(seriesModel, ecModel, api) { var _this = this; this.group.removeAll(); var data = seriesModel.getData(); data.each(function (index) { var model = data.getItemModel(index); var grids = model.get('gridIndex') || [0]; grids.forEach(function (grid) { var sys = api.getCoordinateSystems()[grid]; var shape = model.get('shape'); var xAxisIndex = model.get('xAxisIndex'); var yAxisIndex = model.get('yAxisIndex'); var xAxis = sys.getAxis('x', xAxisIndex); var yAxis = sys.getAxis('y', yAxisIndex); if (xAxis && yAxis && Factory[shape]) { var finder = { xAxisModel: xAxis.model, yAxisModel: yAxis.model }; _this.group.add(Factory[shape](model, sys, finder, api, 0)); } }); }); }, dispose: function dispose() { this.group.removeAll(); } });