当前位置:网站首页>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>
边栏推荐
- 9. Introduction to convolutional neural network
- 网络模型的保存与读取
- NTT template for Tourism
- HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
- Recommend a document management tool mendely Reference Manager
- [deep learning] AI one click to change the sky
- 12.RNN应用于手写数字识别
- Su embedded training - Day9
- Parade ps8625 | replace ps8625 | EDP to LVDS screen adapter or screen drive board
- Vs code configuration latex environment nanny level configuration tutorial (dual system)
猜你喜欢
9. Introduction to convolutional neural network
Cve-2022-28346: Django SQL injection vulnerability
跨模态语义关联对齐检索-图像文本匹配(Image-Text Matching)
jemter分布式
14. Draw network model structure
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
Cs5212an design display to VGA HD adapter products | display to VGA Hd 1080p adapter products
What does interface testing test?
1.线性回归
随机推荐
Handwriting a simulated reentrantlock
8. Optimizer
Codeforces Round #804 (Div. 2)
Password recovery vulnerability of foreign public testing
AI遮天传 ML-回归分析入门
【深度学习】AI一键换天
133. 克隆图
Su embedded training - Day8
German prime minister says Ukraine will not receive "NATO style" security guarantee
5.过拟合,dropout,正则化
Interface test advanced interface script use - apipost (pre / post execution script)
How to use education discounts to open Apple Music members for 5 yuan / month and realize member sharing
130. 被围绕的区域
Y59. Chapter III kubernetes from entry to proficiency - continuous integration and deployment (III, II)
13. Enregistrement et chargement des modèles
NTT template for Tourism
完整的模型训练套路
Complete model training routine
Recommend a document management tool Zotero | with tutorials and learning paths
14.绘制网络模型结构