echarts改变字体颜色

这个博客展示了数字桥梁运维的界面设计,包括桥梁数量的展示和桥梁检测及数据分析的图表。使用了ECharts库来创建主桥温度和主桥中跨跨中梁底应变的折线图,通过轮播表呈现桥梁检测数据,并提供了详细的配置和样式定义。
摘要由CSDN通过智能技术生成
<template>
	<!-- 数字桥梁运维 -->
	<div>
		<item-box title="桥梁数">
			<div class="member-detail">
				<img class="cdj-img" src="../../assets/images/bg.png"/>
				<img class="cdj-img" src="../../assets/images/bg.png"/>
				<img class="cdj-img" src="../../assets/images/bg.png"/>
			</div>
		</item-box>
		<item-box title="检测及数据分析" class="cdj_margin_to">
			<div class="member-detail">
				<dv-scroll-board :config="config" style="width:500px;height:300px;margin-left: 25px;margin-top: 5px;" />
				<div id="bridgeDays" style="width: 600px;height: 285px;margin-left: 30px;"></div>
			</div>
		</item-box>
	</div>
</template>

<script>
	import itemBox from '../element/item-box.vue'
	
	import land from '../../assets/land.js';
	import * as echarts from 'echarts';
	
	export default {
		components: {
			"item-box": itemBox,
		},
		data() {
			return {
				config:{}
			}
		},
		mounted() {
			this.configs();
			this.bridgeDay();
		},
		methods: {
			//轮播表
			configs(){
				var data =  [
					['行1列1', '行1列2', '行1列3'],
					['行2列1', '行2列2', '行2列3'],
					['行3列1', '行3列2', '行3列3'],
					['行4列1', '行4列2', '行4列3'],
					['行5列1', '行5列2', '行5列3'],
					['行6列1', '行6列2', '行6列3'],
					['行7列1', '行7列2', '行7列3'],
					['行8列1', '行8列2', '行8列3'],
					['行9列1', '行9列2', '行9列3'],
					['行10列1', '行10列2', '行10列3']
				];
				this.config = {data: data,
				header: ['桥梁名称', '检测结果', '检测时间'],
				rowNum:6,
				index: true,
				  columnWidth: [50],
				  align: ['center']
				}
			},
			//主桥温度,主桥中跨跨中梁底应变
			bridgeDay(){
				var chartDom = document.getElementById('bridgeDays');
				var myChart = echarts.init(chartDom);
				var option;
				option = {
				  color: ['rgb(255, 88, 105)', 'rgb(35, 130, 255)'],
				  title: {
				    text: ''
				  },
				  tooltip: {
				    trigger: 'axis',
				    axisPointer: {
				      type: 'cross',
				      label: {
				        backgroundColor: '#b1cadd'
				      }
				    }
				  },
				  legend: {
				    data: ['主桥温度', '主桥中跨跨中梁底应变', 'Line 3', 'Line 4', 'Line 5'],
					textStyle:{
					    color:"#fff"
					}
				  },
				
				  grid: {
				    left: '3%',
				    right: '4%',
				    bottom: '3%',
				    containLabel: true
				  },
				  xAxis: [
				    {
				      type: 'category',
				      boundaryGap: false,
				      data: ['1', '2', '3', '4', '5', '6', '7'],
                      axisLine: {
						  lineStyle: {
							  color: "#fff",
						  }
					  }
				    },
				  ],
				  yAxis: [
				    {
				      type: 'value',
                      axisLine: {
						  lineStyle: {
							  color: "#fff",
						  }
					  }
				    }
				  ],
				  series: [
				    {
				      name: '主桥温度',
				      type: 'line',
				      stack: 'Total',
				      smooth: true,
				      lineStyle: {
				        width: 0
				      },
				      showSymbol: false,
				      areaStyle: {
				        opacity: 0.8,
				        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
				          {
				            offset: 0,
				            color: 'rgb(128, 255, 165)'
				          },
				          {
				            offset: 1,
				            color: 'rgb(255, 88, 105)'
				          }
				        ])
				      },
				      emphasis: {
				        focus: 'series'
				      },
				      data: [20, 22, 32, 26, 25, 27, 23]
				    },
				    {
				      name: '主桥中跨跨中梁底应变',
				      type: 'line',
				      stack: 'Total',
				      smooth: true,
				      lineStyle: {
				        width: 0
				      },
				      showSymbol: false,
				      label: {
				        show: true,
				        position: 'top'
				      },
				      areaStyle: {
				        opacity: 0.8,
				        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
				          {
				            offset: 0,
				            color: 'rgb(255, 191, 0)'
				          },
				          {
				            offset: 1,
				            color: 'rgb(35, 130, 255)'
				          }
				        ])
				      },
				      emphasis: {
				        focus: 'series'
				      },
				      data: [35, 37, 39, 32, 40, 36, 33]
				    }
				  ]
				};
				myChart.setOption(option);
			}
			
		}
	}
</script>

<style lang="scss">
	// 轮播表颜色,表头宽度和高度
	.dv-scroll-board .header{
		display: flex;
		flex-direction:row;
		font-size:15;
		width: 500px;
		height: 43px;
	}
	.member-detail {
		display: flex;
		margin-left: -28px;
		.cdj-img{
			margin-top: 6px;
			width: 456px;
			height: 270px;
			border-radius: 5px;
			margin-left: 28px;
		}
	}
</style>

watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5aSn5b6XMzY5,size_20,color_FFFFFF,t_70,g_se,x_16

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大得369

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值