求教,这个动态的排名柱状图,这样写代码,为什么显示不出来

html-css024

求教,这个动态的排名柱状图,这样写代码,为什么显示不出来,第1张

我复制下来了,有语法错误,你的data格式不对

这样试试

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<script src="jquery-3.1.1.min.js"></script>

<script src="echarts.min.js"></script>

</head>

<body>

<div id="main" style="width: 600pxheight:400px"></div>

<script type="text/javascript">

var myChart = echarts.init(document.getElementById('main'))

var option = {

dataset:{source:[

{id:"1022",item:"MAC",value:"21809",rank:"1",trend:"up",occupy:"24.04"},

{id:"1036",item:"ROF",value:"29862",rank:"1",trend:"up",occupy:"21.90"},

{id:"3880",item:"TIN",value:"37439",rank:"1",trend:"up",occupy:"19.23"},

{id:"4881",item:"YCU",value:"44864",rank:"1",trend:"up",occupy:"16.39"},

{id:"5019",item:"ZSS",value:"53822",rank:"1",trend:"up",occupy:"15.24"},

]}

}

myChart.setOption(option)

</script>

</body>

</html>

HTML&CSS 设计与构建网站

ebook:http://www.topbester.com/ebook/download/98803.html

csdn:http://download.csdn.net/download/zhenyangyu/9617037

微盘:http://vdisk.weibo.com/wap/s/zJSMO-iFN8Lez?category_id=35&parents_ref=zJSMO-iFMQi_B

JavaScript&jQuery 交互式Web前端开发

http://www.topbester.com/ebook/download/78156.html