当前位置:网站首页>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>
边栏推荐
- 13. Model saving and loading
- 11. Recurrent neural network RNN
- 股票开户免费办理佣金最低的券商,手机上开户安全吗
- Introduction to ML regression analysis of AI zhetianchuan
- Cross modal semantic association alignment retrieval - image text matching
- Reentrantlock fair lock source code Chapter 0
- AI遮天传 ML-初识决策树
- 大二级分类产品页权重低,不收录怎么办?
- 14.绘制网络模型结构
- 国内首次,3位清华姚班本科生斩获STOC最佳学生论文奖
猜你喜欢

Definition and classification of energy

New library launched | cnopendata China Time-honored enterprise directory

Design method and reference circuit of type C to hdmi+ PD + BB + usb3.1 hub (rj45/cf/tf/ sd/ multi port usb3.1 type-A) multifunctional expansion dock

Recommend a document management tool mendely Reference Manager

Chapter XI feature selection

Analysis of 8 classic C language pointer written test questions

11.递归神经网络RNN

130. 被围绕的区域

How to use education discounts to open Apple Music members for 5 yuan / month and realize member sharing

From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
随机推荐
2.非线性回归
Stock account opening is free of charge. Is it safe to open an account on your mobile phone
Reentrantlock fair lock source code Chapter 0
Introduction to ML regression analysis of AI zhetianchuan
EDP to LVDS conversion design circuit | EDP to LVDS adapter board circuit | capstone/cs5211 chip circuit schematic reference
Su embedded training - Day8
How to use education discounts to open Apple Music members for 5 yuan / month and realize member sharing
Class head up rate detection based on face recognition
Serial port receives a packet of data
130. 被圍繞的區域
ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
Complete model verification (test, demo) routine
Semantic segmentation model base segmentation_ models_ Detailed introduction to pytorch
The weight of the product page of the second level classification is low. What if it is not included?
Chapter VIII integrated learning
Vs code configuration latex environment nanny level configuration tutorial (dual system)
14. Draw network model structure
Ag9310meq ag9310mfq angle two USB type C to HDMI audio and video data conversion function chips parameter difference and design circuit reference
Su embedded training - Day6
Several frequently used OCR document scanning tools | no watermark | avoid IQ tax