From acd4180181be8b2e79ecb348f0d480c8d7fdebb0 Mon Sep 17 00:00:00 2001 From: win10 Date: Thu, 16 Jan 2020 16:24:23 +0800 Subject: [PATCH] 0 --- app/chengji/view/bjtongji/biaoge.html | 37 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/app/chengji/view/bjtongji/biaoge.html b/app/chengji/view/bjtongji/biaoge.html index eaf8d617..998683a8 100644 --- a/app/chengji/view/bjtongji/biaoge.html +++ b/app/chengji/view/bjtongji/biaoge.html @@ -54,12 +54,12 @@
{/block} {block name="echart"} -
+
-
6/12
+
-
6/12
+
{/block} @@ -181,5 +181,36 @@ }; }); }); + + + + // 基于准备好的dom,初始化echarts实例 + var myChart = echarts.init(document.getElementById('main')); + + // 指定图表的配置项和数据 + var option = { + title: { + text: 'ECharts 入门示例' + }, + tooltip: {}, + legend: { + data:['销量'] + }, + xAxis: { + data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"] + }, + yAxis: {}, + series: [{ + name: '销量', + type: 'bar', + data: [5, 20, 36, 10, 10, 20] + }] + }; + + // 使用刚指定的配置项和数据显示图表。 + myChart.setOption(option); + + + {/block} \ No newline at end of file