ECharts关系图配置,求教 如上关系图, 想实现的效果是:把圆替换为圆形的图片(ps:图片素材不确定是圆还是矩形) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 app.title = '力引导布局';myChart.showLoading();$.get('data/asset/data/les-miserables.gexf', function (xml) { myChart.hideLoading(); var graph = echarts.dataTool.gexf.parse(xml); var categories = []; for (var i = 0; i < 9; i++) { categories[i] = { name: '类目' + i }; } graph.nodes.forEach(function (node) { node.itemStyle = ""; node.symbolSize = 30; node.symbol = "image://http://d.lanrentuku.com/down/png/1101/paradise_fruit/apple512.png"; node.value = node.symbolSize; node.category = node.attributes.modularity_class; // Use random x, y node.x = node.y = null; node.draggable = true; }); option = { title: { text: 'Les Miserables', subtext: 'Default layout', top: 'bottom', left: 'right' }, tooltip: {}, legend: [{ // selectedMode: 'single', data: categories.map(function (a) { return a.name; }) }], animation: false, series : [ { name: 'Les Miserables', type: 'graph', layout: 'force', data: graph.nodes, links: graph.links, categories: categories, roam: true, label: { normal: { position: 'right' } }, force: { repulsion: 100 } } ] }; myChart.setOption(option);}, 'xml'); 标注红色居然被转换了。重点是 node.symbol = "image://http://d.lanrentuku.com/down/png/1101/paradise_fruit/apple512.png"; @香蕉猪 非常感谢你的回答,symbol贴上的图片是原来的格式,我需要将矩形的图片裁剪成圆形,不知道如何配置 Ext如何动态修改HTML数据的操作方法??? 冒泡法排序数字,出现问题了? 我想建立一个选择搜索。高人看看该怎么写 向各位大虾求助,怎样用javaScript编写OnClick()事件? 不提交如何获取多个复选框的值 一个关于Javascript及Vbscript当中confirm及msgbox的函数问题, 为什么输入出“document.write(qq)”,那里有错啊? 怎么样让浏览器的历史失效 关于CSS()的识别问题 jquery隐藏/显示前台中所有table 好友列表怎样实现点击每个分组都可以显示或隐藏分组? 求一jquery算法
app.title = '力引导布局';myChart.showLoading();
$.get('data/asset/data/les-miserables.gexf', function (xml) {
myChart.hideLoading(); var graph = echarts.dataTool.gexf.parse(xml);
var categories = [];
for (var i = 0; i < 9; i++) {
categories[i] = {
name: '类目' + i
};
}
graph.nodes.forEach(function (node) {
node.itemStyle = "";
node.symbolSize = 30;
node.symbol = "image://http://d.lanrentuku.com/down/png/1101/paradise_fruit/apple512.png";
node.value = node.symbolSize;
node.category = node.attributes.modularity_class;
// Use random x, y
node.x = node.y = null;
node.draggable = true;
});
option = {
title: {
text: 'Les Miserables',
subtext: 'Default layout',
top: 'bottom',
left: 'right'
},
tooltip: {},
legend: [{
// selectedMode: 'single',
data: categories.map(function (a) {
return a.name;
})
}],
animation: false,
series : [
{
name: 'Les Miserables',
type: 'graph',
layout: 'force',
data: graph.nodes,
links: graph.links,
categories: categories,
roam: true,
label: {
normal: {
position: 'right'
}
},
force: {
repulsion: 100
}
}
]
}; myChart.setOption(option);
}, 'xml');
重点是 node.symbol = "image://http://d.lanrentuku.com/down/png/1101/paradise_fruit/apple512.png";