echarts图表

在这里插入图片描述

<!--
    THIS EXAMPLE WAS DOWNLOADED FROM https://echarts.apache.org/examples/zh/editor.html?c=bar1
-->
<!DOCTYPE html>
<html style="height: 100%">
    <head>
        <meta charset="utf-8">
    </head>
    <body style="height: 100%; margin: 0">
        <div id="container" style="height: 100%"></div>

        
        <script type="text/javascript" src="./js/echarts.min.js"></script>
        <!-- Uncomment this line if you want to dataTool extension
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/extension/dataTool.min.js"></script>
        -->
        <!-- Uncomment this line if you want to use gl extension
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl@2/dist/echarts-gl.min.js"></script>
        -->
        <!-- Uncomment this line if you want to echarts-stat extension
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat@latest/dist/ecStat.min.js"></script>
        -->
        <!-- Uncomment this line if you want to use map
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/map/js/china.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/map/js/world.js"></script>
        -->
        <!-- Uncomment these two lines if you want to use bmap extension
        <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=<Your Key Here>"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@{{version}}/dist/extension/bmap.min.js"></script>
        -->

        <script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};

var option;



option = {
  title: {
    text: '商品价格对比',
    subtext: 'Fake Data'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['Rainfall', 'Evaporation', ]
  },
  toolbox: {
    show: true,
    feature: {
      dataView: { show: true, readOnly: false },
      magicType: { show: true, type: ['line', 'bar'] },
      restore: { show: true },
      saveAsImage: { show: true }
    }
  },
  calculable: true,
  xAxis: [
    {
      type: 'category',
      // prettier-ignore
      data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
    }
  ],
  yAxis: [
    {
      type: 'value'
    }
  ],
  series: [
    
    {
      name: '衬衫',
      type: 'bar',
      data: [
        5,5,12,20,21,21,15,17,8,7,22,12
      ],
      markPoint: {
        data: [
          { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
          { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
        ]
      },
      markLine: {
        data: [{ type: 'average', name: 'Avg' }]
      }
    },
	{
	  name: '羊毛纱',
	  type: 'bar',
	  data: [
	    20,18,30,22,22,24,9,12,21,24,22,12
	  ],
	  markPoint: {
	    data: [
	      { type: 'max', name: 'Max' },
	      { type: 'min', name: 'Min' }
	    ]
	  },
	  markLine: {
	    data: [{ type: 'average', name: 'Avg' }]
	  }
	},
	{
	  name: '雪纺衫',
	  type: 'bar',
	  data: [
	    36,20,20,23,28,21,13,16,12,28,21,22
	  ],
	  markPoint: {
	    data: [
	      { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
	      { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
	    ]
	  },
	  
	  markLine: {
	    data: [{ type: 'average', name: 'Avg' }]
	  }
	},
	{
	  name: '裤子',
	  type: 'bar',
	  data: [
	    36,20,20,23,28,21,13,16,12,28,21,22
	  ],
	  markPoint: {
	    data: [
	      { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
	      { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
	    ]
	  },
	  
	  markLine: {
	    data: [{ type: 'average', name: 'Avg' }]
	  }
	},
	{
	  name: '高跟鞋',
	  type: 'bar',
	  data: [
	    20,18,30,22,22,24,9,12,21,24,22,12
	  ],
	  markPoint: {
	    data: [
	      { type: 'max', name: 'Max' },
	      { type: 'min', name: 'Min' }
	    ]
	  },
	  markLine: {
	    data: [{ type: 'average', name: 'Avg' }]
	  }
	},
	{
	  name: '袜子',
	  type: 'bar',
	  data: [
	    5,5,12,20,21,21,15,17,8,7,22,12
	  ],
	  markPoint: {
	    data: [
	      { type: 'max', name: 'Max' },
	      { type: 'min', name: 'Min' }
	    ]
	  },
	  markLine: {
	    data: [{ type: 'average', name: 'Avg' }]
	  }
	}
  ]
};

if (option && typeof option === 'object') {
    myChart.setOption(option);
}

        </script>
    </body>
</html>
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值