echart instance

<body>
  <!-- Prepare a Dom with size (width and height) for ECharts -->
  <div id="main" style="height:400px"></div>
  <!-- ECharts single file introduction -->
  <script src="http://echarts.baidu.com/build/dist/echarts-all.js"></script>
  <script type="text/javascript">
  // Based on the prepared dom, initialize the echarts chart
  var myChart = echarts.init(document.getElementById('main'));
   
  var option = {
  tooltip: {
  show: true
  },
  legend: {
  data:['Sales']
  },
  xAxis: [
  {
  type : 'category',
  data : ["shirt","cardigan","chiffon shirt","trousers","high heels","socks"]
  }
  ],
  yAxis : [
  {
  type : 'value'
  }
  ],
  series : [
  {
  "name":"销量",
  "type":"bar",
  "data":[5, 20, 40, 10, 10, 20]
  }
  ]
  };
   
  // Load data for echarts object
  myChart.setOption(option);
  </script>
  </body>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326989818&siteId=291194637