|
@@ -1,65 +1,32 @@
|
|
<template>
|
|
<template>
|
|
- <div id="grade"></div>
|
|
|
|
|
|
+ <div id="grade"></div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
<script>
|
|
<script>
|
|
- export default {
|
|
|
|
|
|
+ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dataIndex: 1,
|
|
dataIndex: 1,
|
|
progressHistogram: undefined,
|
|
progressHistogram: undefined,
|
|
- option:{
|
|
|
|
- backgroundColor: "#344b58",
|
|
|
|
- "title": {
|
|
|
|
- "text": "本年商场顾客男女人数统计",
|
|
|
|
- "subtext": "BY Wang Dingding",
|
|
|
|
- x: "4%",
|
|
|
|
-
|
|
|
|
- textStyle: {
|
|
|
|
- color: '#fff',
|
|
|
|
- fontSize: '22'
|
|
|
|
- },
|
|
|
|
- subtextStyle: {
|
|
|
|
- color: '#90979c',
|
|
|
|
- fontSize: '16',
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- "tooltip": {
|
|
|
|
- "trigger": "axis",
|
|
|
|
- "axisPointer": {
|
|
|
|
- "type": "shadow",
|
|
|
|
- textStyle: {
|
|
|
|
- color: "#fff"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- "grid": {
|
|
|
|
- "borderWidth": 0,
|
|
|
|
- "top": 110,
|
|
|
|
- "bottom": 95,
|
|
|
|
- textStyle: {
|
|
|
|
- color: "#fff"
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "legend": {
|
|
|
|
- x: '4%',
|
|
|
|
- top: '8%',
|
|
|
|
- textStyle: {
|
|
|
|
- color: '#90979c',
|
|
|
|
- },
|
|
|
|
- "data": ['女', '男', '平均']
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- "calculable": true,
|
|
|
|
- "xAxis": [{
|
|
|
|
|
|
+ dataInfo: []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods:{
|
|
|
|
+ getData() {
|
|
|
|
+ let data = this.$Mock.data.studentList
|
|
|
|
+ console.log(data)
|
|
|
|
+ for (var i = 1; i < 15; i++) {
|
|
|
|
+ this.dataInfo.push(i);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getMap() {
|
|
|
|
+ let myChart = this.$echarts.init(document.getElementById('grade'));
|
|
|
|
+ let option = {
|
|
|
|
+ color: ["#42beda"],
|
|
|
|
+ tooltip: {},
|
|
|
|
+ xAxis: {
|
|
"type": "category",
|
|
"type": "category",
|
|
"axisLine": {
|
|
"axisLine": {
|
|
- lineStyle: {
|
|
|
|
- color: '#90979c'
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
"splitLine": {
|
|
"splitLine": {
|
|
"show": false
|
|
"show": false
|
|
@@ -74,108 +41,64 @@
|
|
"interval": 0,
|
|
"interval": 0,
|
|
|
|
|
|
},
|
|
},
|
|
- "data": xData,
|
|
|
|
- }],
|
|
|
|
- "yAxis": [{
|
|
|
|
- "type": "value",
|
|
|
|
- "splitLine": {
|
|
|
|
- "show": false
|
|
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: 'white'
|
|
},
|
|
},
|
|
- "axisLine": {
|
|
|
|
|
|
+ data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
|
|
|
|
+ },
|
|
|
|
+ yAxis: {
|
|
|
|
+ splitLine: {
|
|
lineStyle: {
|
|
lineStyle: {
|
|
- color: '#90979c'
|
|
|
|
|
|
+ color: ['#505050']
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- "axisTick": {
|
|
|
|
- "show": false
|
|
|
|
- },
|
|
|
|
- "axisLabel": {
|
|
|
|
- "interval": 0,
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- "splitArea": {
|
|
|
|
- "show": false
|
|
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: 'white'
|
|
},
|
|
},
|
|
-
|
|
|
|
- }],
|
|
|
|
|
|
+ },
|
|
"dataZoom": [{
|
|
"dataZoom": [{
|
|
"show": true,
|
|
"show": true,
|
|
- "height": 30,
|
|
|
|
|
|
+ "height": 10,
|
|
"xAxisIndex": [
|
|
"xAxisIndex": [
|
|
0
|
|
0
|
|
],
|
|
],
|
|
- bottom: 30,
|
|
|
|
|
|
+ bottom: 10,
|
|
"start": 10,
|
|
"start": 10,
|
|
"end": 80,
|
|
"end": 80,
|
|
- handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
|
|
|
|
handleSize: '110%',
|
|
handleSize: '110%',
|
|
handleStyle: {
|
|
handleStyle: {
|
|
color: "#d3dee5",
|
|
color: "#d3dee5",
|
|
|
|
|
|
},
|
|
},
|
|
- textStyle: {
|
|
|
|
- color: "#fff"
|
|
|
|
- },
|
|
|
|
borderColor: "#90979c"
|
|
borderColor: "#90979c"
|
|
-
|
|
|
|
-
|
|
|
|
- }, {
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
"type": "inside",
|
|
"type": "inside",
|
|
"show": true,
|
|
"show": true,
|
|
"height": 15,
|
|
"height": 15,
|
|
"start": 1,
|
|
"start": 1,
|
|
"end": 35
|
|
"end": 35
|
|
}],
|
|
}],
|
|
- "series": [{
|
|
|
|
- "name": "初一 一班",
|
|
|
|
- "type": "bar",
|
|
|
|
- "stack": "总量",
|
|
|
|
- "barMaxWidth": 35,
|
|
|
|
- "barGap": "10%",
|
|
|
|
- "itemStyle": {
|
|
|
|
- "normal": {
|
|
|
|
- "color": "rgba(255,144,128,1)",
|
|
|
|
- "label": {
|
|
|
|
- "show": true,
|
|
|
|
- "textStyle": {
|
|
|
|
- "color": "#fff"
|
|
|
|
- },
|
|
|
|
- "position": "inside",
|
|
|
|
- formatter: function (p) {
|
|
|
|
- return p.value > 0 ? (p.value) : '';
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "data": [
|
|
|
|
- 85,
|
|
|
|
- 97,
|
|
|
|
- 55,
|
|
|
|
- 61,
|
|
|
|
- 71,
|
|
|
|
- 33,
|
|
|
|
- 54,
|
|
|
|
- 85,
|
|
|
|
- 58,
|
|
|
|
- 72,
|
|
|
|
- 84,
|
|
|
|
- 40
|
|
|
|
- ],
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
|
|
+ series: [{
|
|
|
|
+ name: '销量',
|
|
|
|
+ type: 'bar',
|
|
|
|
+ data: [5, 20, 36, 10, 10, 20]
|
|
|
|
+ }]
|
|
|
|
+ };
|
|
|
|
+ myChart.setOption(option);
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.grade = this.$echarts.init(document.getElementById('grade'))
|
|
|
|
- this.grade.setOption(this.option)
|
|
|
|
|
|
+ this.getData()
|
|
|
|
+ this.getMap()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
-<style>
|
|
|
|
|
|
+<style scoped>
|
|
#grade{
|
|
#grade{
|
|
- width:100%;
|
|
|
|
- height:100%;
|
|
|
|
|
|
+ width:650px;
|
|
|
|
+ height:300px;
|
|
|
|
+ margin:auto;
|
|
}
|
|
}
|
|
-
|
|
|
|
</style>
|
|
</style>
|