73 lines
2.3 KiB
HTML
73 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>组合Greeks随时间变化曲线</title>
|
|
<script type="text/javascript" src="../../Statics/libs/echarts/echarts.min.js"></script>
|
|
<script type="text/javascript" src="../../Statics/libs/echarts/echarts-gl.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<h3 style="text-align:center">组合Pv随时间变化曲线</h3>
|
|
<div id="PvChart" style="height:400px;width:700px;margin:0 auto"></div>
|
|
</div>
|
|
<br />
|
|
<div>
|
|
<h3 style="text-align:center">组合Delta随时间变化曲线</h3>
|
|
<div id="DeltaChart" style="height:400px;width:700px;margin:0 auto"></div>
|
|
</div>
|
|
<br />
|
|
<div>
|
|
<h3 style="text-align:center">组合Gamma随时间变化曲线</h3>
|
|
<div id="GammaChart" style="height:400px;width:700px;margin:0 auto"></div>
|
|
</div>
|
|
<br />
|
|
<div>
|
|
<h3 style="text-align:center">组合Vega随时间变化曲线</h3>
|
|
<div id="VegaChart" style="height:400px;width:700px;margin:0 auto"></div>
|
|
</div>
|
|
<br />
|
|
<div>
|
|
<h3 style="text-align:center">组合Theta随时间变化曲线</h3>
|
|
<div id="ThetaChart" style="height:400px;width:700px;margin:0 auto"></div>
|
|
</div>
|
|
</body>
|
|
<script type="text/javascript">
|
|
|
|
function drawLineChart(divName, line) {
|
|
var myChart = echarts.init(document.getElementById(divName));
|
|
var option = {
|
|
xAxis: {
|
|
type: 'category'
|
|
},
|
|
yAxis: {
|
|
type: 'value'
|
|
},
|
|
series: [{
|
|
type: 'line',
|
|
symbol: 'none',
|
|
smooth: true
|
|
}]
|
|
};
|
|
|
|
option.xAxis.data = [];
|
|
option.series[0].data = [];
|
|
for (var i = 0; i < line.length; ++i) {
|
|
option.xAxis.data.push(i);
|
|
option.series[0].data.push([line[i].X, line[i].Y]);
|
|
}
|
|
myChart.clear();
|
|
myChart.setOption(option);
|
|
}
|
|
|
|
var lines = JSON.parse(window.sessionStorage.getItem("pricing_greeks_line"));
|
|
|
|
if (lines) {
|
|
drawLineChart("PvChart", lines["Pv"]);
|
|
drawLineChart("DeltaChart", lines["Delta"]);
|
|
drawLineChart("GammaChart", lines["Gamma"]);
|
|
drawLineChart("VegaChart", lines["Vega"]);
|
|
drawLineChart("ThetaChart", lines["Theta"]);
|
|
}
|
|
</script>
|
|
</html> |