Commit 107d70ce authored by ZhangKai's avatar ZhangKai

update: 修改 统计功能 折线图和环形图显示样式

parent 0a321e0d
......@@ -109,9 +109,9 @@
<!-- echarts图容器 -->
<div v-loading="loading" class="echarts-box">
<!-- 时间段车流量波动展示 -->
<div ref="flowNumberChart" class="flow-number" />
<div ref="flowNumberChart" class="flow-number"/>
<!-- 车型流量占比统计 -->
<div ref="flowRatioChart" class="flow-ratio" />
<div ref="flowRatioChart" class="flow-ratio"/>
</div>
</div>
</template>
......@@ -198,6 +198,8 @@ export default {
flowNumberData: [],
// 车型流量占比数据
flowRatioData: [],
// 时间段车流量图例
legendContent: '日报',
// 测试数据
testData: {
flow: [
......@@ -316,9 +318,23 @@ export default {
}
},
tooltip: {
trigger: 'axis' // 添加 tooltip 属性
trigger: 'axis', // 添加 tooltip 属性
formatter: function(params) {
return params[0].name + ' 客运量 ' + params[0].value
}
},
legend: {
orient: 'horizontal',
x: 'center',
y: 'top',
top: '10%',
textStyle: {
fontSize: 15
},
data: [this.legendContent]
},
series: [{
name: this.legendContent,
type: 'line',
smooth: true,
data: this.flowNumberData[0] // 使用 flowNumberData
......@@ -417,6 +433,17 @@ export default {
// this.resetQueryParams()
// this.getNowDate()
this.queryParams.timePoint = null
if (this.queryParams.dataType === 'day') {
this.legendContent = '日报'
} else if (this.queryParams.dataType === 'week') {
this.legendContent = '周报'
} else if (this.queryParams.dataType === 'month') {
this.legendContent = '月报'
} else if (this.queryParams.dataType === 'year') {
this.legendContent = '年报'
} else {
this.legendContent = '日报'
}
},
/** 获取当前日期 */
// 在组件的方法中更新查询参数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment