echarts遍历区域折线图,单线和多线

2024-09-04 23:04

本文主要是介绍echarts遍历区域折线图,单线和多线,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

在这里插入图片描述

// 单线折线图drawonelineCharts(){var echarts = require("echarts");var lineCharts = document.getElementsByClassName('lineChart'); // 对应地使用ByClassNamethis.linecolor=['#01FFD4','#1C70DD','#01FFD4','#1C70DD','#01FFD4','#1C70DD']for(var i = 0;i < lineCharts.length;i++ ){ // 通过for循环,在相同class的dom内绘制元素var myChart = echarts.init(lineCharts[i]);myChart.setOption({color:this.linecolor[i],// color:'#01FFD4',tooltip: {trigger: 'axis',axisPointer: {animation: false}},legend: {},grid: [{left: 40,right: 40,}, {left: 40,right: 40,}],xAxis: [{type: 'category',boundaryGap: false,axisLine: {onZero: true},data:this.linelist[i].xaxis,}, {gridIndex: 1}],yAxis: [{type: 'value',}, {gridIndex: 1}],series: [{name: this.linelist[i].chartTitle,type: 'line',smooth: true,symbol: 'circle',symbolSize: 9,showSymbol: false,markArea: {silent: true,label: {normal: {position: ['10%', '50%']}},data:[this.linelist[i].stackList]},data:this.linelist[i].yaxis}]},true)}},

在这里插入图片描述

// 双线折线图drawtwolineCharts(){var echarts = require("echarts");var lineCharts = document.getElementsByClassName('lineChart'); // 对应地使用ByClassNamethis.linecolor=['#01FFD4','#1C70DD','#01FFD4','#1C70DD','#01FFD4','#1C70DD']for(var i = 0;i < lineCharts.length;i++ ){ // 通过for循环,在相同class的dom内绘制元素var myChart = echarts.init(lineCharts[i]);myChart.setOption({color:this.linecolor[i],// color:'#01FFD4',tooltip: {trigger: 'axis',axisPointer: {animation: false}},legend: {},grid: [{left: 40,right: 40,}, {left: 40,right: 40,}],xAxis: [{type: 'category',boundaryGap: false,axisLine: {onZero: true},data:this.linelist[i].xaxis,}, {gridIndex: 1}],yAxis: [{type: 'value',}, {gridIndex: 1}],series: this.linelist[i].yaxis},true)}},

折线图样式

//  中和岗位折线图getneutralizeline(){neutralizeline(this.time).then((response) => {let linecolor=['#01FFD4','#1C70DD']for (let i = 0; i < response.data.length; i++) {let _this=thisresponse.data[i].yaxis.forEach((item,index) => {_this.$set(item, 'type', 'line')_this.$set(item, 'smooth', true)_this.$set(item, 'itemStyle', {color:linecolor[index]})})}this.linelist=response.datathis.$nextTick(()=> {this.drawtwolineCharts()})})},

折线图数据

{"msg": "操作成功","code": 200,"data": [{"chartTitle": "中和PH值","legend": null,"unit": null,"xaxis": ["08:00","09:00","10:00","02:00","03:00","04:00","05:00","06:00","07:00"],"yaxis": [{"name": "中和PH值","data": ["1","2","34","3","14.5","15.2","27","16.6","17.3"],"markArea": {"data": [[{"yAxis": 11},{"yAxis": 18}]]}}]},{"chartTitle": "中和糖度(12-14BX)","legend": null,"unit": null,"xaxis": ["08:00","09:00","10:00","23:00","00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00"],"yaxis": [{"name": "中和糖度(12-14BX)","data": ["11.7","12.4","13.1","13.8","14.5","5.4","34","11","21","12.4"],"markArea": {"data": [[{"yAxis": 12},{"yAxis": 16}]]}}]},{"chartTitle": "杀菌温度(A)","legend": null,"unit": null,"xaxis": ["08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","04:00","05:00","06:00","07:00"],"yaxis": [{"name": "杀菌温度(A)","data": ["15.9","16.6","17.3","34.4","4.7","5.4","6.1","23.3","40"],"markArea": {"data": [[{"yAxis": 5},{"yAxis": 8}]]}},{"name": "杀菌温度(B)","data": ["6.1","9","14","7","16","23","4.23","15.6","23.5","43.2","45.3","43.2","3.5"],"markArea": {"data": [[{"yAxis": 5},{"yAxis": 7}]]}}]},{"chartTitle": "均值压力(A)","legend": null,"unit": null,"xaxis": ["03:00","04:00","05:00","06:00","07:00"],"yaxis": [{"name": "均值压力(A)","data": ["13.8","35","15.2","23","8.9","24"],"markArea": {"data": [[{"yAxis": 11},{"yAxis": 15}]]}},{"name": "均值压力(B)","data": ["18","23","13.1","23","14.5","15.2","25","16.6","30"],"markArea": {"data": [[{"yAxis": 4},{"yAxis": 8}]]}}]},{"chartTitle": "高压压力(A)","legend": null,"unit": null,"xaxis": ["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00"],"yaxis": [{"name": "高压压力(A)","data": ["11.7","12.4","22","32","14.5","15.2","12","34","46","24"],"markArea": {"data": [[{"yAxis": 19},{"yAxis": 25}]]}},{"name": "高压压力(B)","data": ["13.8","14.5","15.2","17","34","17.3","29","16.6","17.3"],"markArea": {"data": [[{"yAxis": 19},{"yAxis": 23}]]}}]}]
}
{"msg": "操作成功","code": 200,"data": [{"chartTitle": "辅料6","legend": null,"unit": null,"stackList": [{"yAxis": 5},{"yAxis": 12}],"xaxis": ["08:00","09:40","12:00","15:00","18:00","21:00","23:00","02:00","05:40","07:00"],"yaxis": ["7","10","13","16","19","22","25","28","34","3"]},{"chartTitle": "辅料5","legend": null,"unit": null,"stackList": [{"yAxis": 5},{"yAxis": 19}],"xaxis": ["08:00","09:40","12:00","15:00","18:00","21:00","23:00","02:00","05:40","07:00"],"yaxis": ["7","10","13","16","19","22","25","28","34","3"]}]
}

option = {
tooltip: {
trigger: 'axis',axisPointer: {
animation: false
}},
legend: {
data: ['流量'],
x: 'left'
},
axisPointer: {
link: {
xAxisIndex: 'all'
}},
grid: [{
left: 40,
right: 40,
}, {
left: 40,
right: 40,
}],
xAxis: [{type: 'category',
boundaryGap: false,
axisLine: {
onZero: true
},
data: ['0:00', '0:30',
'1:00', '1:30',
'2:00', '2:30',
'3:00', '3:30',
'4:00', '4:30',]
}, {
gridIndex: 1
}],yAxis: [{type: 'value',
}, {
gridIndex: 1
}],
series: [{
name: '数值',
type: 'line',
smooth: true,
markArea: {
silent: true,
data: [
[{
yAxis: 100,
}, {
yAxis: 200
}],
]
},
data: [113, 223, 332, 223, 232, 223, 322, 123, 222,32, 222, 232, 132, 123, 212]
},
{name:'报警',
type: 'line',
smooth: true,
data: [3,5,4,2,223, 332, 223, 232, 223, 322, 123, 222,32, 222, 232, 11,7,6],
markArea: {
silent: true,
data: [
[{
yAxis: 10,
}, {
yAxis: 90
}],
]
},
},
]
};

这篇关于echarts遍历区域折线图,单线和多线的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1137288

相关文章

leetcode105 从前序与中序遍历序列构造二叉树

根据一棵树的前序遍历与中序遍历构造二叉树。 注意: 你可以假设树中没有重复的元素。 例如,给出 前序遍历 preorder = [3,9,20,15,7]中序遍历 inorder = [9,3,15,20,7] 返回如下的二叉树: 3/ \9 20/ \15 7   class Solution {public TreeNode buildTree(int[] pr

PHP实现二叉树遍历(非递归方式,栈模拟实现)

二叉树定义是这样的:一棵非空的二叉树由根结点及左、右子树这三个基本部分组成,根据节点的访问位置不同有三种遍历方式: ① NLR:前序遍历(PreorderTraversal亦称(先序遍历)) ——访问结点的操作发生在遍历其左右子树之前。 ② LNR:中序遍历(InorderTraversal) ——访问结点的操作发生在遍历其左右子树之中(间)。 ③ LRN:后序遍历(PostorderT

react笔记 8-17 属性绑定 class绑定 引入图片 循环遍历

1、绑定属性 constructor(){super()this.state={name:"张三",title:'我是一个title'}}render() {return (<div><div>aaaaaaa{this.state.name}<div title={this.state.title}>我是一个title</div></div></div>)} 绑定属性直接使用花括号{}   注

YOLOv8/v10+DeepSORT多目标车辆跟踪(车辆检测/跟踪/车辆计数/测速/禁停区域/绘制进出线/绘制禁停区域/车道车辆统计)

01:YOLOv8 + DeepSort 车辆跟踪 该项目利用YOLOv8作为目标检测模型,DeepSort用于多目标跟踪。YOLOv8负责从视频帧中检测出车辆的位置,而DeepSort则负责关联这些检测结果,从而实现车辆的持续跟踪。这种组合使得系统能够在视频流中准确地识别并跟随特定车辆。 02:YOLOv8 + DeepSort 车辆跟踪 + 任意绘制进出线 在此基础上增加了用户

HighCharts 折线图的实现

Java和HighCharts结合,实现折线图; 代码下载:Java和Highcharts实现折线图

hashmap的存值,各种遍历方法

package com.jefflee;import java.util.HashMap;import java.util.Iterator;import java.util.Map;public class HashmapTest {// 遍历Hashmap的四种方法public static void main(String[] args) {//hashmap可以存一个null,把

JVM - Java内存区域

文章目录 目录 文章目录 运行时数据区域 程序计数器 栈 Java虚拟机栈 本地方法栈 栈帧的组成 局部变量表 操作数栈 帧数据 堆 方法区 直接内存 总结 运行时数据区域 Java虚拟机在执行Java程序的过程中会把它所管理的内存区域划分为若干个不同的数据区域。这些区域有各自的用途,以及创建和销毁时间,有的区域随着虚拟机进程的启动而一直存在,有的区域则是依赖

Knight Moves -uva 简单的BFS遍历

昨天刚学了BFS的遍历,在uva上找了个题敲了出来,感觉还不错,最近敲代码挺有手感的,希望这种状态保持下去 #include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#define MAX_SIZE 10 + 5#define LEN 100 + 10using namespace std;in

Ai+若依(智能售货机运营管理系统---帝可得)-人员管理-点位管理-区域管理-合作商管理----【08篇---0001:上】

项目介绍 售货机简介 帝可得是一个基于物联网概念下的智能售货机运营管理系统 物联网 物联网(IoT:Internet of Things)简单来说,就是让各种物品通过互联网连接起来,实现信息的交换和通信。 这个概念听起来可能有点抽象,但我们可以把它想象成一个超级大的社交网络。不过,这个网络里的成员不是人类,而是各种物品。比如,你的冰箱、洗衣机、甚至是你的汽车,它们都可以通过互联网互

笔试强训,[NOIP2002普及组]过河卒牛客.游游的水果大礼包牛客.买卖股票的最好时机(二)二叉树非递归前序遍历

目录 [NOIP2002普及组]过河卒 牛客.游游的水果大礼包 牛客.买卖股票的最好时机(二) 二叉树非递归前序遍历 [NOIP2002普及组]过河卒 题里面给的提示很有用,那个马的关系,后面就注意,dp需要作为long的类型。 import java.util.Scanner;// 注意类名必须为 Main, 不要有任何 package xxx 信息publ