求助 echarts 节点如何拖动

ttigerdna 2017-12-07 05:09:34
按照https://www.w3cschool.cn/echarts_tutorial/echarts_tutorial-d5b128yu.html文章
我怎么也弄不出来
我的代码:

myChart = echarts.init(document.getElementById('echartsMain'));

//
option = {
title: {
text: '风区70米风速',
subtext: ''
},
tooltip: {
trigger: 'axis'
},
grid: {
},
legend: {
data:['风速']
},
toolbox: {
show: true,
feature: {
dataZoom : {show: true},
restore : {show: true},
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
//data: ['周一','周二','周三','周四','周五','周六','周日']
data: []
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value} m/s'
}
},
dataZoom: [
{
type: 'slider',
xAxisIndex: 0,
filterMode: 'empty'
},
{
type: 'slider',
yAxisIndex: 0,
filterMode: 'empty'
},
{
type: 'inside',
xAxisIndex: 0,
filterMode: 'empty'
},
{
type: 'inside',
yAxisIndex: 0,
filterMode: 'empty'
}
],
series: [
{
name:'风速',
id: 'a',
type:'line',
//data:[11, 11, 15, 13, 12, 13, 10],
data:[],
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
},
markLine: {
data: [
{type: 'average', name: '平均值'}
]
}
}
]
};
//

myChart.on('dataZoom', updatePosition);
myChart.setOption(option);
myChart.hideLoading();

myChart.setOption({
graphic: echarts.util.map(windv70, function (item, dataIndex) {
return {
type: 'circle',
position: myChart.convertToPixel('grid', item),
shape: {
cx: 0,
cy: 0,
r: symbolSize / 2
},
invisible: true,
draggable: true,
ondrag: echarts.util.curry(onPointDragging, dataIndex),
onmousemove: echarts.util.curry(showTooltip, dataIndex),
onmouseout: echarts.util.curry(hideTooltip, dataIndex),
z: 100
};
})
});

window.addEventListener('resize', updatePosition);

function updatePosition() {
myChart.setOption({
graphic: echarts.util.map(windv70, function (item, dataIndex) {
return {
position: myChart.convertToPixel('grid', item)
};
})
});
}

function showTooltip(dataIndex) {
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: dataIndex
});
}

function hideTooltip(dataIndex) {
myChart.dispatchAction({
type: 'hideTip'
});
}

function onPointDragging(dataIndex, dx, dy) {
windv70[dataIndex] = myChart.convertFromPixel('grid', this.position);

// Update data
myChart.setOption({
series: [{
id: 'a',
data: windv70
}]
});
}

...全文
265 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文提出一种基于鱼鹰优化算法(OOA)优化的CNN-BiGUR-Attention混合模型,用于提升短期风电功率预测的精度与稳定性,采用Matlab实现代码仿真。该模型融合卷积神经网络(CNN)提取输入数据的局部空间特征,利用双向门控循环单元(BiGUR)捕捉风速、功率等时间序列的前后向动态依赖关系,并引入注意力机制自适应强化关键时间步的特征权重,从而增强模型对非平稳风电数据的表征能力;进一步,采用OOA算法对模型超参数进行全局寻优,有效提升模型收敛速度与泛化性能。研究基于实际风电场历史数据开展实验验证,结果表明,该方法相较传统模型在预测精度、鲁棒性和误差抑制方面表现更优,适用于高比例可再生能源接入背景下的电力系统调度需求。; 适合人群:从事新能源发电预测、电力系统优化调度、智能算法与深度学习融合应用等方向的科研人员及工程技术人员,尤其适合具备Matlab编程能力、熟悉时间序列建模与深度学习框架的研究者。; 使用场景及目标:①实现风电场短期功率高精度预测,支撑电网安全稳定调度与能量管理;②为深度学习模型结构设计与智能优化算法联合调参提供实践范例;③推动人工智能技术在可再生能源预测、智能电网运行等领域的落地应用。; 阅读建议:建议结合提供的Matlab代码深入理解CNN-BiGUR-Attention网络架构搭建、注意力机制实现方式及OOA优化流程,重点关注数据预处理、模型训练与参数调优细节,可通过替换不同风电数据集进行对比实验,进一步掌握模型迁移能力与适应性。

87,990

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧