Commit 7cf5c116 by chenwq

折线图

1 parent d7aadb22
<template> <template>
<div class="line-box"> <div class="line-box">
<div id="echarts-line" class="echarts-line"></div> <div id="line-chart" class="line-chart"></div>
<div class="rank-box"> <div class="rank-box">
<div> <div>
<p :class="[ 'rank-title', rankFlag == 'first' ? 'rank-active' : '' ]" @click="handleRankChange('first')">前5{{ storeOrBrandTxt }}</p> <p :class="[ 'rank-title', rankFlag == 'first' ? 'rank-active' : '' ]" @click="handleRankChange('first')">前5{{ storeOrBrandTxt }}</p>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import getLineOptions from './lineOptions' import getLineOptions from './lineOptions'
export default { export default {
name: 'EchartLine', name: 'LineChart',
props: { props: {
// height: { // height: {
...@@ -91,9 +91,9 @@ export default { ...@@ -91,9 +91,9 @@ export default {
}, },
drawLine() { drawLine() {
// var lineDom = document.getElementById('echarts-line') // var lineDom = document.getElementById('line-chart')
// this.echartsLine = echarts.init(lineDom) // this.echartsLine = echarts.init(lineDom)
this.echartsLine = echarts.init(document.getElementById('echarts-line')) this.echartsLine = echarts.init(document.getElementById('line-chart'))
this.dealxAxisLabel() this.dealxAxisLabel()
this.lineOptions.series[0].data = this.dataList this.lineOptions.series[0].data = this.dataList
...@@ -120,7 +120,7 @@ p { ...@@ -120,7 +120,7 @@ p {
color: #ffffff; color: #ffffff;
// padding: 4px 8px; // padding: 4px 8px;
font-size: 0.75em; font-size: 0.75em;
.echarts-line { .line-chart {
width: 100%; width: 100%;
height: calc(100% - 3.1vh - 4.6vh); height: calc(100% - 3.1vh - 4.6vh);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<template> <template>
<div> <div>
<div class="title">售后档案客户</div> <div class="title">售后档案客户</div>
<echart-line :height="height"></echart-line> <LineChart :height="height"></LineChart>
</div> </div>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!