数据折线图展示

在这里插入图片描述

<div class="container">
		<div class="row">
			<div class="col-md-6">
				<div id='main' style="width: 900px; height: 500px;">
					
				</div>
			</div>
		</div>
	</div>

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="js/jquery.min.js" ></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="js/bootstrap.min.js" ></script>
	<script src="js/echarts.min.js" ></script>
	<script type="text/javascript">
		// 基于准备好的dom,初始化echarts实例
		var myChart = echarts.init(document.getElementById('main'));
		
		      // 指定图表的配置项和数据
		var option = {
		  title: {
			text: '商品名称'
		  },
		  tooltip: {
			trigger: 'axis',
			axisPointer: {
			  type: 'cross',
			  label: {
				backgroundColor: '#6a7985'
			  }
			}
		  },
		  legend: {
			data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋','袜子']
		  },
		  toolbox: {
			feature: {
			  saveAsImage: {}
			}
		  },
		  grid: {
			left: '3%',
			right: '4%',
			bottom: '3%',
			containLabel: true
		  },
		  xAxis: [
			{
			  type: 'category',
			  boundaryGap: false,
			  data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月',
			  '八月', '九月', '十月', '十一月', '十二月']
			}
		  ],
		  yAxis: [
			{
			  type: 'value',
			  min:0,
			  max:150,
			}
		  ],
		 
		  series: [
			{
			  name: '衬衫',
			  type: 'line',
			  stack: 'Total',
			  areaStyle: {},
			  emphasis: {
				focus: 'series'
			  },
			  data: [5,	6	,12,	20,	21,	21,	15,	17,	8,	7,	22,	12
		]
			},
			{
			  name: '羊毛衫',
			  type: 'line',
			  stack: 'Total',
			  areaStyle: {},
			  emphasis: {
				focus: 'series'
			  },
			  data: [20,	18,	30,	22,	22,	24,	9,	12,	21,	24,	22,	12
		]
			},
			{
			  name: '雪纺衫',
			  type: 'line',
			  stack: 'Total',
			  areaStyle: {},
			  emphasis: {
				focus: 'series'
			  },
			  data: [36, 20, 20,	23,	28,	21,	13,	16,	12,	28, 21, 22
		]
			},
			{
			  name: '裤子',
			  type: 'line',
			  stack: 'Total',
			  areaStyle: {},
			  emphasis: {
				focus: 'series'
			  },
			  data: [10,	12,	18,	21,	25,	22,	12,	14,	32,	21,	18,	21
		]
			},
			{
			  name: '高跟鞋',
			  type: 'line',
			  stack: 'Total',
			  areaStyle: {},
			  emphasis: {
				focus: 'series'
			  },
			  data: [10,	11,	17,	18,	13,	12,	14,	21,	12,	31,	21,	18
		]
			},
			{
			  name: '袜子',
			  type: 'line',
			  stack: 'Total',
			  label: {
				show: true,
				position: 'top'
			  },
			  areaStyle: {},
			  emphasis: {
				focus: 'series'
			  },
			  data: [20,	19,	22,	21,	23,	21,	19,	24,	32,	21,	24,	21
		]
			}
		  ]
		};
		
		      // 使用刚指定的配置项和数据显示图表。
		      myChart.setOption(option);
		 
	</script>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值