首页 > 科技 >

ECharts+BaiduMap+HT for Web网络拓扑图应用(4)

2019-01-30 02:45:08 网络整理 阅读:175 评论:0

接下来就是创建panel图表组件了,这是HT for Web的Panel组件的基本用法,其中content属性的值可以是HT for Web的任何组件或div元素,如果是HT fro Web组件的话,该组件必须实现了validateImpl方法,因为在panel的属性变化后将会调用content对应组件的validateImpl方法来重新布局组件内容。

4.ECharts和GraphView拓扑图组件的交互:

legendSelectedFun = function(param) {

if(chart._legendSelect){

delete chart._legendSelect;

return;

}

console.info(param);

var id = nodeMap[param.target],

dm = graphView.dm(),

data = dm.getDataById(id),

sm = dm.sm(),

selection = sm.getSelection();

if(param.selected[param.target]) {

sm.appendSelection([data]);

if(selectionData.indexOf(param.target)

= 0){

selectionData.splice(index, 1);

}

}

sm.setSelection(selection.toArray());

};

graphView.mi(function(e){

console.info(e.kind, e.data);

var c = chart.getChart(),

legend = c.component.legend,

selectedMap = legend.getSelectedMap();

if(e.kind === 'endRectSelect'){

chart._legendSelect = true;

for(var name in notes){

legend.setSelected(name, false);

}

notes = {};

graphView.dm().sm().each(function(data){

var note = data.s('note');

if(note)

notes[note] = 1;

});

for(var name in notes){

legend.setSelected(name, true);

相关文章