当前位置:网站首页>Basic realization of line graph
Basic realization of line graph
2022-07-08 01:11:00 【Just love life】
Implementation steps
ECharts The most basic code structure :
introduce js file ,DOM Containers , Initialize object , Set up option
x Axis data :
data 1:[‘1 month ’,‘2 month ’,‘3 month ’,‘4 month ’,‘5 month ’,‘6 month ’,‘7 month ’,‘8 month ’,‘9 month ’,‘10 month ’,‘11 month ’,‘12 month ’]
y Axis data :
data 2:[3000,2800,900,1000,800,700,1400,1300,900,1000,800,600]
Chart type :
stay series Lower setup type:line
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 yDaraArr=[3000,2800,900,1000,800,700,1400,1300,900,1000,800,600] var option={
xAxis:{
type:'category' ,// Taxonomic axis
data:xDataArr
}, yAxis:{
type:'value' ,// Value axis
}, series:[
{
name:' a brand of instant noodles ',
type:'line', //bar It's a histogram ,line It's linear ,pie It's pie shaped
data:yDaraArr
}
]
}
// step 5: Set the configuration item to echarts Instance object
mCharts.setOption(option)
</script>
</body>
</html>
边栏推荐
- Class head up rate detection based on face recognition
- 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
- 9. Introduction to convolutional neural network
- 8.优化器
- Chapter XI feature selection
- Service mesh introduction, istio overview
- 13.模型的保存和載入
- What does interface testing test?
- Chapter 5 neural network
- Redis, do you understand the list
猜你喜欢
随机推荐
Password recovery vulnerability of foreign public testing
Definition and classification of energy
串口接收一包数据
STL--String类的常用功能复写
[go record] start go language from scratch -- make an oscilloscope with go language (I) go language foundation
How does starfish OS enable the value of SFO in the fourth phase of SFO destruction?
完整的模型验证(测试,demo)套路
国内首次,3位清华姚班本科生斩获STOC最佳学生论文奖
Invalid V-for traversal element style
Chapter 16 intensive learning
第四期SFO销毁,Starfish OS如何对SFO价值赋能?
Using GPU to train network model
130. Surrounding area
Ag7120 and ag7220 explain the driving scheme of HDMI signal extension amplifier | ag7120 and ag7220 design HDMI signal extension amplifier circuit reference
Chapter VIII integrated learning
New library launched | cnopendata China Time-honored enterprise directory
基于卷积神经网络的恶意软件检测方法
Letcode43: string multiplication
大二级分类产品页权重低,不收录怎么办?
8.优化器


![[deep learning] AI one click to change the sky](/img/74/f2e854b9f24129bcd9376733c2369f.png)






