当前位置:网站首页>Basic implementation of pie chart
Basic implementation of pie chart
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
Data preparation :[{name:??,value:??},{},{}]
TaoBao :12111 JD.COM :23322 Vipshop :33223 Jumei.com :67899 1 Number point :1223
take type Is set to type
<!-- ECharts The most basic code structure : 1. introduce js file ,DOM Containers , Initialize object , Set up option 2. Data preparation :[{
name:??,value:??},{
},{
}] 3. TaoBao :12111 JD.COM :23322 Vipshop :33223 Jumei.com :67899 1 Number point :1223 4. take type Is set to type --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <!-- step 1: introduce echarts.js file --> <script src="lib/echarts.min.js"></script> </head> <body> <!-- step 2: Prepare a box to present the chart --> <div style="width: 600px;height: 400px;"></div> <script> // step 3: initialization echarts Instance object // Parameters ,dom, Decide where the icon will eventually appear var mCharts= echarts.init(document.querySelector('div')) // step 4: Prepare the data TaoBao :12111 JD.COM :23322 Vipshop :33223 Jumei.com :67899 1 Number point :1223 var pieData=[
{
name:' TaoBao ',
value:12111
},
{
name:' JD.COM ',
value :23322
},
{
name:' Vipshop ',
value:33223
},
{
name:' Jumei.com ',
value:67899
},
{
name:'1 Shop No. ',
value:1223
}
] // step 5: Prepare configuration items var option={
series:[
{
name:' shopping ',
type:'pie', //bar It's a histogram ,line It's linear ,pie It's pie shaped
data:pieData
}
]
}
// step 5: Set the configuration item to echarts Instance object
mCharts.setOption(option)
</script>
</body>
</html>
边栏推荐
- Marubeni official website applet configuration tutorial is coming (with detailed steps)
- 9. Introduction to convolutional neural network
- Study notes of single chip microcomputer and embedded system
- A network composed of three convolution layers completes the image classification task of cifar10 data set
- Markdown learning (entry level)
- HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
- New library online | information data of Chinese journalists
- Is it safe to speculate in stocks on mobile phones?
- A speed Limited large file transmission tool for every major network disk
- Fundamentals - integrating third-party technology
猜你喜欢
How to write mark down on vscode
Parade ps8625 | replace ps8625 | EDP to LVDS screen adapter or screen drive board
USB type-C docking design | design USB type-C docking scheme | USB type-C docking circuit reference
Analysis of 8 classic C language pointer written test questions
Ag9310 for type-C docking station scheme circuit design method | ag9310 for type-C audio and video converter scheme circuit design reference
A network composed of three convolution layers completes the image classification task of cifar10 data set
基于人脸识别实现课堂抬头率检测
133. Clone map
Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description
Redis, do you understand the list
随机推荐
12. RNN is applied to handwritten digit recognition
新库上线 | 中国记者信息数据
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
Authorization code of Axure rp9
NTT template for Tourism
From starfish OS' continued deflationary consumption of SFO, the value of SFO in the long run
14. Draw network model structure
2022-07-07: the original array is a monotonic array with numbers greater than 0 and less than or equal to K. there may be equal numbers in it, and the overall trend is increasing. However, the number
C# ?,?.,?? .....
Stock account opening is free of charge. Is it safe to open an account on your mobile phone
My best game based on wechat applet development
Su embedded training - Day8
Get started quickly using the local testing tool postman
High quality USB sound card / audio chip sss1700 | sss1700 design 96 kHz 24 bit sampling rate USB headset microphone scheme | sss1700 Chinese design scheme explanation
[deep learning] AI one click to change the sky
串口接收一包数据
Parade ps8625 | replace ps8625 | EDP to LVDS screen adapter or screen drive board
Su embedded training - Day7
Cs5261type-c to HDMI alternative ag9310 | ag9310 alternative
Prediction of the victory or defeat of the League of heroes -- simple KFC Colonel