UNPKG

@dfsj/echarts

Version:

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

12 lines (10 loc) 1.68 kB
/** * * @dfsj/echarts: 专业的水文曲线组件或构造函数以及通用的echart二次封装图表 * 版本: v4.0.0-alpha.9 * 作者:yangbo <1747837358@qq.com> * 日期:2026-07-10 17:09:23 * * */ import{to as t,min as n,max as o,sum as e,avg as d}from"./tools.js";import{CATEGORY as l}from"../config.js";function i(i,a){var c,r,u,s=null==a?void 0:a.dimensions,v=null==i?void 0:i.getOption(),m=null==v||null===(c=v.dataset[0])||void 0===c?void 0:c.source,h=null==v?void 0:v.dataZoom[0],f=h.startValue,p=h.endValue,b=null==v?void 0:v.series.filter(function(t){return!1!==v.legend[0].selected[t.name]&&"mark"!==t.type}).map(function(i){var a=i.encode.y,c=!!(s[a].code&l.RAINFALL),r=t(n(m,a,f,p)),u=t(o(m,a,f,p)),v=t(c&&e(m,a,f,p)),h=t(d(m,a,f,p));return"<tr><td>".concat(i.name,"</td><td>").concat(r,"</td><td>").concat(u,"</td><td>").concat(h,"</td><td>").concat(v,"</td></tr>")}).join("");return'<div class="time">'.concat(null==m||null===(r=m[f])||void 0===r?void 0:r[0]," ~ ").concat(null==m||null===(u=m[p])||void 0===u?void 0:u[0],"</div>\n <table>\n <thead>\n <tr>\n <th>类目</th>\n <th>最小值</th>\n <th>最大值</th>\n <th>平均值</th>\n <th>累计值</th>\n </tr>\n </thead>\n <tbody>\n ").concat(b," \n </tbody>\n </table>")}function a(t,n){var o;return null==n||null===(o=n.dimensions)||void 0===o?void 0:o.map(function(t,n){return{label:"string"==typeof t?t:t.name,field:n,selected:t.selected}})}export{a as dimensions,i as statistics};