引入jquery.js,echarts.js文件
<script src="js/jquery.js"></script>
<script src="js/echarts.js"></script>
<body>
<div id="charts" style="min-width:150px;min-height:150px;height:100%;height:100%">
</body>
<script type='text/javascript'>
function fnRainFall(year) {
var Chart = echarts.init(document.getElementById('charts'));
option = {
tooltip: { //提示框设置
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)", //提示框显示格式 <br/> 换行
position: function () { //提示框对于饼图的位置
return ['50%', '50%']
}
},
legend: {
show:ture, //图例是否显示 默认true 显示
orient: 'vertical', //图例 垂直显示