日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Echarts之水库水位

發(fā)布時(shí)間:2024/1/18 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Echarts之水库水位 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

echarts版本:4.8.0
效果圖:

實(shí)現(xiàn):

<template><divid="chart"style="width: 480px; height: 650px; background: #020f2b"></div> </template><script> export default {data() {return {};},created() {},mounted() {this.initChart();},methods: {initChart() {var maxHeight = "65"; //最大高度/堤壩高度let markline = ["62", "57", "50", "0"]; //設(shè)計(jì)水位,汛限水位,當(dāng)前水位,校核水位let normalColor = "#CBDDFF";let option = {xAxis: {type: "category",data: [""],axisTick: { show: false },axisLabel: {fontSize: 16,color: normalColor,},axisLine: {lineStyle: {color: "#FFF",width: 1,},},splitLine: {lineStyle: {color: "#FFF",},},},yAxis: {nameTextStyle: {fontSize: 16,color: normalColor,},max: maxHeight,min: 0,boundaryGap: [1, 1],type: "value",axisLine: {show: true,lineStyle: {color: "#FFF",width: 1,},},axisTick: { show: false },axisLabel: {fontSize: 16,color: normalColor,},splitLine: {show: false,lineStyle: {color: "#FFF",type: "dotted",opacity: 0.02,width: 1,},},splitNumber: 5,},grid: {top: "20%",right: "20%",left: "3%",bottom: "12%",containLabel: true,},graphic: {elements: [{type: "image",right: "3%",top: "18%",z: 5,bounding: "raw",origin: [0, 0],style: {image: require("../images/reservoir.png"),width: 130,height: 460,},},{type: "text",right: 0,top: "10%",right: "5%",z: 5,style: {text: "堤壩高度:" + maxHeight + "m",fill: "#FFF",fontSize: 16,},},],},series: [{type: "bar",data: [markline[2]],barCategoryGap: "-100%",itemStyle: {color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: "#0493df" },{ offset: 1, color: "#0345a3" },]),},markLine: {silent: true, //鼠標(biāo)移入高亮 true不高亮data: [{label: {position: "middle",fontSize: 18,formatter: "{c}m",color: "#FF0",},name: "設(shè)計(jì)洪水位",yAxis: markline[0],lineStyle: { type: "solid", color: "#FF0", width: 1 },},{label: {position: "middle",fontSize: 18,formatter: "{c}m",color: "#FF473A",},name: "汛限水位",yAxis: markline[1],lineStyle: { type: "solid", color: "#FF473A", width: 1 },},{label: {position: "middle",fontSize: 18,formatter: "{c}m",color: "#1106df",},name: "當(dāng)前水位",yAxis: markline[2],lineStyle: { type: "solid", color: "#1106df", width: 1 },},{label: {position: "insideMiddleBottom",fontSize: 18,formatter: "{c}m",color: "#FFF",},name: "校核洪水位",yAxis: markline[3],lineStyle: { type: "solid", color: "#FFF", width: 1 },},],},},],};let myChart = this.$echarts.init(document.getElementById("chart"));myChart.setOption(option);window.addEventListener("resize", () => {myChart.resize();});},} }; </script>

附圖片:

以上

總結(jié)

以上是生活随笔為你收集整理的Echarts之水库水位的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。