Skip to content

Commit

Permalink
和弦例子更新
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Nov 1, 2013
1 parent 4b77be7 commit 8babcb6
Show file tree
Hide file tree
Showing 4 changed files with 323 additions and 171 deletions.
31 changes: 18 additions & 13 deletions doc/example/chord.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,25 @@
<textarea id="code" name="code">
option = {
title : {
text: '测试数据',
subtext: 'From d3.js',
x:'right',
y:'bottom'
text: '测试数据'
},
tooltip : {
trigger: 'item'
},
legend: {
x: 'left',
x: 'right',
data:['g1','g2', 'g3', 'g4']
},
series : [
{
type:'chord',
sort : 'ascending',
sortSub : 'descending',
radius : ['55%', '75%'],
center : ['50%', '50%'],
padding : 2,
sort : 'descending', // can be 'none', 'ascending', 'descending'
sortSub : 'descending', // can be 'none', 'ascending', 'descending'
startAngle : 90,
clockWise : false,
showScale : true,
showScaleText : true,
data : [
Expand All @@ -96,15 +98,18 @@
],
itemStyle : {
normal : {
label : {
show : false
label: {
show: true,
color: 'red'
}
}
},
matrix : [[11975, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],
[ 8010, 16145, 8090, 8045],
[ 1013, 990, 940, 6907]]
matrix : [
[11975, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],
[ 8010, 16145, 8090, 8045],
[ 1013, 990, 940, 6907]
]
}
]
};
Expand Down
184 changes: 28 additions & 156 deletions doc/example/chord1.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,171 +69,43 @@
<textarea id="code" name="code">
option = {
title : {
text : '中东地区的敌友关系',
subtext: '数据来自财新网',
text: '测试数据',
subtext: 'From d3.js',
x:'right',
y:'bottom'
},
tooltip : {
trigger: 'item',
formatter : function(params) {
var g1 = params[1];
var serie = params[0];
var g2 = params[3];
var data = params[2];
var data2 = params[4];
if (data2) {
if (data > data2) {
return [g1, serie, g2].join(' ');
} else {
return [g2, serie, g1].join(' ');
}
} else {
return g1
}
}
trigger: 'item'
},
legend : {
data : [
'美国',
'叙利亚反对派',
'阿萨德',
'伊朗',
'塞西',
'哈马斯',
'以色列',
'穆斯林兄弟会',
'基地组织',
'俄罗斯',
'黎巴嫩什叶派',
'土耳其',
'卡塔尔',
'沙特',
'黎巴嫩逊尼派',
'',
'支持',
'反对',
'未表态'
],
orient : 'vertical',
x : 'left'
legend: {
x: 'left',
data:['group1','group2', 'group3', 'group4']
},
series : [
{
"name": "支持",
"type": "chord",
"showScaleText": false,
"data": [
{"name": "美国"},
{"name": "叙利亚反对派"},
{"name": "阿萨德"},
{"name": "伊朗"},
{"name": "塞西"},
{"name": "哈马斯"},
{"name": "以色列"},
{"name": "穆斯林兄弟会"},
{"name": "基地组织"},
{"name": "俄罗斯"},
{"name": "黎巴嫩什叶派"},
{"name": "土耳其"},
{"name": "卡塔尔"},
{"name": "沙特"},
{"name": "黎巴嫩逊尼派"}
],
"matrix": [
[0,100,0,0,0,0,100,0,0,0,0,0,0,0,0],
[10,0,0,0,0,10,10,0,10,0,0,10,10,10,10],
[0,0,0,10,0,0,0,0,0,10,10,0,0,0,0],
[0,0,100,0,0,100,0,0,0,0,100,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,10,0],
[0,100,0,10,0,0,0,0,0,0,0,0,10,0,0],
[10,100,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,10,10,0,0],
[0,100,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,100,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,100,10,0,0,0,0,0,0,0,0,0,0,0],
[0,100,0,0,0,0,0,100,0,0,0,0,0,0,0],
[0,100,0,0,0,100,0,100,0,0,0,0,0,0,0],
[0,100,0,0,100,0,0,0,0,0,0,0,0,0,100],
[0,100,0,0,0,0,0,0,0,0,0,0,0,10,0]
]
},
{
"name": "反对",
"type": "chord",
"showScaleText": false,
"data": [
{"name": "美国"},
{"name": "叙利亚反对派"},
{"name": "阿萨德"},
{"name": "伊朗"},
{"name": "塞西"},
{"name": "哈马斯"},
{"name": "以色列"},
{"name": "穆斯林兄弟会"},
{"name": "基地组织"},
{"name": "俄罗斯"},
{"name": "黎巴嫩什叶派"},
{"name": "土耳其"},
{"name": "卡塔尔"},
{"name": "沙特"},
{"name": "黎巴嫩逊尼派"}
type:'chord',
sort : 'ascending',
sortSub : 'descending',
showScale : true,
showScaleText : true,
data : [
{name : 'group1'},
{name : 'group2'},
{name : 'group3'},
{name : 'group4'}
],
"matrix": [
[0,0,100,100,0,100,0,0,100,0,0,0,0,0,0],
[0,0,0,10,0,0,0,0,0,10,10,0,0,0,0],
[10,0,0,0,0,0,10,10,10,0,0,10,10,0,10],
[10,100,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,10,0,100,0,0,0,10,10,0,0],
[10,0,0,0,100,0,10,0,0,0,0,0,0,0,0],
[0,0,100,0,0,100,0,0,0,0,0,0,0,0,0],
[0,0,100,0,10,0,0,0,0,0,0,0,0,10,0],
[10,0,100,0,0,0,0,0,0,0,0,0,0,100,0],
[0,100,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,100,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,100,0,100,0,0,0,0,0,0,0,0,0,0],
[0,0,100,0,100,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,100,10,0,0,0,0,0,0],
[0,0,100,0,0,0,0,0,0,0,0,0,0,0,0]
]
},
{
"name": "未表态",
"type": "chord",
"showScaleText": false,
"data": [
{"name": "美国"},
{"name": "叙利亚反对派"},
{"name": "阿萨德"},
{"name": "伊朗"},
{"name": "塞西"},
{"name": "哈马斯"},
{"name": "以色列"},
{"name": "穆斯林兄弟会"},
{"name": "基地组织"},
{"name": "俄罗斯"},
{"name": "黎巴嫩什叶派"},
{"name": "土耳其"},
{"name": "卡塔尔"},
{"name": "沙特"},
{"name": "黎巴嫩逊尼派"}
],
"matrix": [
[0,0,0,0,100,0,0,100,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[10,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[10,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
itemStyle : {
normal : {
label : {
show : false
}
}
},
matrix : [
[11975, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],
[ 8010, 16145, 8090, 8045],
[ 1013, 990, 940, 6907]
]
}
]
Expand Down
Loading

0 comments on commit 8babcb6

Please sign in to comment.