老師,工具箱所有圖標(biāo)都顯示不出來(lái)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Js</title>
<style>
.red{
border:1px solid red;
}
</style>
</head>
<body>
<!-- 為ECharts準(zhǔn)備一個(gè)具備大小的Dom -->
<div id="main" style="width:900px;height:600px"></div>
<script src="echarts.min.js"></script>
<script>
// 基于準(zhǔn)備好的Dom,初始化echarts實(shí)例
var myChart=echarts.init(document.getElementById('main'));
//指定圖表的配置項(xiàng)和數(shù)據(jù)
var options={
//標(biāo)題
title:{
text:'ECharts入門實(shí)例',
subtext:'學(xué)習(xí)ECharts就來(lái)木妖王',
textStyle:{
fontSize:30
},
subtextStyle:{
align:'center'
},
left:'right',
borderColor:'red',
borderWidth:5
},
//工具箱
toolBox:{
show:true,
feature:{
saveAsImage:{
show:true
},
dataView:{
show:true
},
restore:{
show:true
},
dataZoom:{
show:true
},
magicType:{
type:['line','bar']
}
}
},
//圖例
legend:{
data:['銷量','產(chǎn)量']
},
//x軸
xAxis:{
data:['襯衫','羊毛衫','雪紡衫','褲子','高跟鞋','襪子']
},
//y軸
yAxis:{},
//數(shù)據(jù)
series:[{
name:'銷量',
type:'bar',
data:[5,15,25,13,23,6]
},{
name:'產(chǎn)量',
type:'line',
data:[7,30,89,55,67,88]
}]
}
//使用剛指定的配置項(xiàng)和數(shù)據(jù)顯示圖表
myChart.setOption(options)
</script>
</body>
</html>
2019-07-23
工具箱的配置項(xiàng)是:toolbox,而你的代碼中寫的toolBox,請(qǐng)諒解!
2019-07-22
<script src="echarts.min.js"></script>
這個(gè)放head里面試試