当前位置:网站首页>Basic realization of line chart (II)
Basic realization of line chart (II)
2022-07-08 01:11:00 【Just love life】
11.7 In the version updated on the th ,y Axis is not displayed by default , Just add the following
Fill the style areaStyle
Next to the edge boundaryGap
The zoom : Out of the 0 Value ratio
scale:true
If the data is close , Big numbers , The line chart will show a straight line , Out of the 0 Value proportion can solve this problem
If you want to show several different data in a chart , As long as Series Add objects under the array
Stacking effect :
stack
Pictured above , Because the two line charts are based on 0 For reference , So there will be cross phenomenon , If the second graph is drawn on the basis of the first graph, it will not cross .
stay series Inside stack As long as the two values remain the same , Then the second one will be drawn on the basis of the first one , No cross .
add areaStyle, The effect is more obvious
Code
<!-- 1.ECharts The most basic code structure 2.x Axis data :['1 month ','2 month ','3 month ','4 month ','5 month ','6 month ','7 month ','8 month ','9 month ','10 month ','11 month ','12 month '] 3.y Axis data :[3000,2800,900,1000,800,700,1400,1300,900,1000,800,600] 4. take type Is set to bar --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script src="lib/echarts.min.js"></script> </head> <body> <div style="width: 600px;height: 400px;"></div> <script> var mCharts= echarts.init(document.querySelector('div')) var xDataArr=['1 month ','2 month ','3 month ','4 month ','5 month ','6 month ','7 month ','8 month ','9 month ','10 month ','11 month ','12 month '] var yDaraArr1=[3000,2200,3004,2706,1008,2001,4002,4506,3903,3601,2501,3807] var yDaraArr2=[2000,4025,3058,3806,2728,3821,3432,3856,3323,3021,3501,3837] var option={
xAxis:{
type:'category' ,// Taxonomic axis
data:xDataArr,
boundaryGap:false
}, yAxis:{
type:'value', scale:true, axisLine:{
show:true
}
}, series:[
{
name:' a brand of instant noodles ', type:'line', //bar It's a histogram ,line It's linear ,pie It's pie shaped data:yDaraArr1, stack:'all', areaStyle:{
}
},{
neme:' Unified ', type:'line', data:yDaraArr2, stack:'all', areaStyle:{
}
}
]
}
// step 5: Set the configuration item to echarts Instance object
mCharts.setOption(option)
</script>
</body>
</html>
边栏推荐
- 第四期SFO销毁,Starfish OS如何对SFO价值赋能?
- AI遮天传 ML-回归分析入门
- HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
- Prediction of the victory or defeat of the League of heroes -- simple KFC Colonel
- Basic types of 100 questions for basic grammar of Niuke
- 11. Recurrent neural network RNN
- Serial port receives a packet of data
- 2.非线性回归
- Is it safe to speculate in stocks on mobile phones?
- 130. Zones environnantes
猜你喜欢
基于微信小程序开发的我最在行的小游戏
Scheme selection and scheme design of multifunctional docking station for type C to VGA HDMI audio and video launched by ange in Taiwan | scheme selection and scheme explanation of usb-c to VGA HDMI c
Ag9310 for type-C docking station scheme circuit design method | ag9310 for type-C audio and video converter scheme circuit design reference
Capstone/cs5210 chip | cs5210 design scheme | cs5210 design data
Chapter XI feature selection
4.交叉熵
基于卷积神经网络的恶意软件检测方法
Letcode43: string multiplication
Ag7120 and ag7220 explain the driving scheme of HDMI signal extension amplifier | ag7120 and ag7220 design HDMI signal extension amplifier circuit reference
How to write mark down on vscode
随机推荐
How to transfer Netease cloud music /qq music to Apple Music
Su embedded training - Day8
13.模型的保存和載入
12. RNN is applied to handwritten digit recognition
12.RNN应用于手写数字识别
9.卷积神经网络介绍
letcode43:字符串相乘
[reprint] solve the problem that CONDA installs pytorch too slowly
新库上线 | 中国记者信息数据
Design method and application of ag9311maq and ag9311mcq in USB type-C docking station or converter
Scheme selection and scheme design of multifunctional docking station for type C to VGA HDMI audio and video launched by ange in Taiwan | scheme selection and scheme explanation of usb-c to VGA HDMI c
Vscode is added to the right-click function menu
Kubernetes static pod (static POD)
2. Nonlinear regression
New library launched | cnopendata China Time-honored enterprise directory
串口接收一包数据
Codeforces Round #804 (Div. 2)
Two methods for full screen adaptation of background pictures, background size: cover; Or (background size: 100% 100%;)
新库上线 | CnOpenData中国星级酒店数据
4.交叉熵