-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstrategy.html
200 lines (189 loc) · 5.49 KB
/
strategy.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Strtegy</title>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<!-- 引入 echarts.js -->
<script src="support/echarts.simple.min.js"></script>
<style>
.firstDiv p{text-align: center}
#main {width: 600px;height:400px;}
#frontier canvas{width: 600px}
.table{margin-top: 50px;}
.table caption{font-size: 20px;font-size: 2em;font-weight: 900}
</style>
</head>
<body>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div>
<div class="firstDiv" style="overflow: hidden">
<div id="main" style="float: left;width: 600px"></div>
<div id="frontier" style="float: left;height:400px;width: 680px;margin-left: 200px;"></div>
</div>
<!--<div id="frontier" style="width: 600px;height:400px;> </div>-->
<table class="table table-bordered">
<caption>Portfolio</caption>
<thead>
<tr>
<th>名称</th>
<th>数量</th>
<th>当前值</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>3</td>
<td>3</td>
</tr>
<tr>
4
</tr>
<tr>
5
</tr>
<tr>
66666
</tr>
<tr>
7
</tr>
<tr>
8
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
myChart.setOption({
series : [
{
name: '访问来源',
type: 'pie',
radius: '55%',
data:[
{value:20, name:'option'},
{value:65, name:'future'},
{value:15, name:'stock'}
]
}
]
})
// 使用刚指定的配置项和数据显示图表。
// myChart.setOption(option);
var secondChart=echarts.init(document.getElementById('frontier'));
option = {
title: {
text: '阶梯瀑布图',
subtext: 'From ExcelHome',
sublink: 'http://e.weibo.com/1341556070/Aj1J2x5a5'
},
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
formatter: function (params) {
var tar;
if (params[1].value != '-') {
tar = params[1];
}
else {
tar = params[0];
}
return tar.name + '<br/>' + tar.seriesName + ' : ' + tar.value;
}
},
legend: {
data:['支出','收入']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [
{
name:'Risk%(Standard Deviation)',
type : 'category',
splitLine: {show:false},
data : function (){
var list = [];
for (var i = 0; i <= 100;) {
list.push( i);
i+=10;
}
return list;
}()
}
],
yAxis : [
{
name : 'return %',
type : 'value'
}
],
series : [
{
name:'辅助',
type:'bar',
stack: '总量',
itemStyle:{
normal:{
barBorderColor:'rgba(0,0,0,0)',
color:'rgba(0,0,0,0)'
},
emphasis:{
barBorderColor:'rgba(0,0,0,0)',
color:'rgba(0,0,0,0)'
}
},
data:[0,20,40,60,80,100]
},
{
name:'收入',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'top'}}}
// data:[900, 345, 393, '-', '-', 135, 178, 286, '-', '-', '-']
},
{
name:'支出',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'bottom'}}}
// data:['-', '-', '-', 108, 154, '-', '-', '-', 119, 361, 203]
}
]
};
secondChart.setOption(option);
</script>
</body>
</html>