6月16日

尝试做图表联动,之前在结对作业中实现过想看看能不能实现,

// 移入该区域时,高亮
myChart.on('mouseOver', function(params){
console.log(params);//此处写点击事件内容
for(var i=0;i<dataList.length;i++){
// data11[i].value="0";
if(params.name == dataList[i].name){
console.log(params.name);
//addressList[i].value="1";
//选中高亮
// myChart.dispatchAction({ type: 'highlight', name:params.name});
$(".map-table tbody tr").eq(i).addClass('highTr');

}
}
});
// 移出该区域时,取消高亮
myChart.on('mouseOut', function(params){
console.log(params);//此处写点击事件内容
for(var i=0;i<dataList.length;i++){
// data11[i].value="0";
if(params.name == dataList[i].name){
console.log(params.name);
//取消高亮
// myChart.dispatchAction({ type: 'downplay', name:params.name});

$(".map-table tbody tr").eq(i).removeClass('highTr');
}
}
});

$("#tab tbody tr").mouseover(function(){
$(this).find("td").addClass("highTr");
var hang = $(this).prevAll().length;
myChart.dispatchAction({ type: 'highlight', name:dataList[hang].name});//选中高亮
});

/**
* 鼠标移出的颜色
*/
$("#tab tbody tr").mouseout(function(){
$(this).find("td").removeClass("highTr");
var hang = $(this).prevAll().length;
myChart.dispatchAction({ type: 'downplay', name:dataList[hang].name});//取消高亮
});

修改未能成功,时间并不宽裕。步入考试周,心急如焚。

原文地址:https://www.cnblogs.com/buyaoya-pingdao/p/14901233.html