@dfsj/echarts
Version:
专业的水文曲线组件或构造函数以及通用的echart二次封装图表
154 lines (150 loc) • 3.64 kB
JavaScript
/**
*
* @dfsj/echarts: 专业的水文曲线组件或构造函数以及通用的echart二次封装图表
* 版本: v3.7.0-alpha.5
* 作者:yangbo <1747837358@qq.com>
* 日期:2025-11-21 13:30:34
*
*
*/
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import assign from '../../utils/assign.js';
import config, { CATEGORY, axis, options } from '../../config.js';
import { to } from '../../utils/tools.js';
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var def = assign({}, options, {
$indices: [],
$statistical: 100,
$appendable: 3,
$mark: {
shape: {
text: {
label: {
offset: [0, '101%']
}
}
}
},
$series: [{
$code: CATEGORY.RAINFALL,
name: '降雨量',
type: 'bar',
barMaxWidth: 5,
yAxisIndex: 0,
large: true,
itemStyle: {
color: null
},
markPoint: {
data: [{
type: 'max',
symbolSize: 1,
label: {
offset: [0, 12],
color: 'inherit',
fontWeight: 'bold',
fontSize: 14,
formatter: function formatter(e) {
return to(e.value, '0.0');
}
}
}]
}
}, {
$code: ~CATEGORY.RAINFALL,
type: 'line',
yAxisIndex: 1,
smooth: true,
large: true,
emphasis: {
itemStyle: {
opacity: 0.8
}
},
itemStyle: {
opacity: 0
},
markPoint: {
data: [{
type: 'max',
symbolSize: 2,
label: {
offset: [0, -7],
color: 'inherit',
fontWeight: 'bold',
fontSize: 14,
formatter: function formatter(e) {
return to(e.value);
}
}
}]
}
}],
title: {
show: false,
text: '降雨关系图'
},
grid: {
top: 60,
bottom: 60,
left: 80,
right: 80
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
legend: {
show: true,
top: 10
},
dataZoom: [{
type: 'slider',
brushSelect: false,
handleIcon: config.icon.zoom,
handleSize: '60%',
realtime: true,
throttle: 30,
height: 20,
bottom: 10
}, {
type: 'inside'
}],
xAxis: [_objectSpread(_objectSpread({}, axis), {}, {
name: '时间',
type: 'category',
position: 'top',
boundaryGap: false,
axisLine: {
onZero: false
},
nameGap: 30
})],
yAxis: [_objectSpread(_objectSpread({
$layout: CATEGORY.RAINFALL
}, axis), {}, {
type: 'value',
nameLocation: 'middle',
nameGap: 50,
inverse: true,
nameTextStyle: {
align: 'right'
},
min: 0,
max: function max(v) {
return Math.round(v.max + (v.max - v.min) * 0.1);
}
}), _objectSpread(_objectSpread({
$layout: ~CATEGORY.RAINFALL
}, axis), {}, {
type: 'value',
nameLocation: 'middle',
nameGap: 50,
min: 0,
max: 100
})]
});
export { def as default };