当前位置:网站首页>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>
边栏推荐
- C# ?,?.,?? .....
- USB type-C mobile phone projection scheme | USB type-C docking station scheme | TV / projector type-C converter scheme | ag9300ag9310ag9320
- 新库上线 | 中国记者信息数据
- How does starfish OS enable the value of SFO in the fourth phase of SFO destruction?
- 12.RNN应用于手写数字识别
- String usage in C #
- NVIDIA Jetson test installation yolox process record
- STL--String类的常用功能复写
- Design method and application of ag9311maq and ag9311mcq in USB type-C docking station or converter
- 基于人脸识别实现课堂抬头率检测
猜你喜欢
130. Surrounding area
Password recovery vulnerability of foreign public testing
[necessary for R & D personnel] how to make your own dataset and display it.
7.正则化应用
第四期SFO销毁,Starfish OS如何对SFO价值赋能?
Capstone/cs5210 chip | cs5210 design scheme | cs5210 design data
Several frequently used OCR document scanning tools | no watermark | avoid IQ tax
Su embedded training - Day6
Binder core API
AI zhetianchuan ml novice decision tree
随机推荐
12. RNN is applied to handwritten digit recognition
Cve-2022-28346: Django SQL injection vulnerability
4.交叉熵
基于卷积神经网络的恶意软件检测方法
13. Model saving and loading
Handwriting a simulated reentrantlock
Jemter distributed
Is it safe to speculate in stocks on mobile phones?
10. CNN applied to handwritten digit recognition
The whole life cycle of commodity design can be included in the scope of industrial Internet
How is it most convenient to open an account for stock speculation? Is it safe to open an account on your mobile phone
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
AI遮天传 ML-初识决策树
Saving and reading of network model
Codeforces Round #804 (Div. 2)
1. Linear regression
图像数据预处理
Codeforces Round #804 (Div. 2)
NVIDIA Jetson test installation yolox process record
新库上线 | CnOpenData中国星级酒店数据