当前位置:网站首页>Generic configuration legend
Generic configuration legend
2022-07-08 01:11:00 【Just love life】
legend: legend , Used to filter series , Need and series In combination with
legend Medium data Is an array
legend Medium data The value of needs and series Of a set of data in an array name Value consistent 
Code
<!-- 1.ECharts The most basic code structure 2.x Axis data :[' Zhang San ',‘ Li Si ’,‘ Wang Wu ’,‘ Intercalary soil ’,‘ Xiao Ming ’,‘ maotai ’,‘ Er Niu ’,‘ Daqiang ’] 3.y Axis data :[88,92,63,77,94,80,72,86] 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=[' Zhang San ',' Li Si ',' Wang Wu ',' Intercalary soil ',' Xiao Ming ',' maotai ',' Er Niu ',' Daqiang '] var yDaraArr1=[70,92,85,89,77,90,87,98] var yDaraArr2=[76,82,85,89,79,90,80,98] var option={
title:{
text:' Results show ', textStyle:{
color:'blue'
},
borderWidth:5,
borderColor:'blue',
borderRadius:5,
left:30,
top:10
}, tooltip:{
trigger:'axis', triggerOn:'click', // formatter:'{b} The results of {c}' formatter:function(arg){
return arg[0].name+' My score is '+arg[0].data
}
}, toolbox:{
feature:{
saveAsImage:{
},// Export pictures dataView:{
}, // Data view restore:{
} , // Data reset ( Restore ) dataZoom:{
}, // Area zoom magicType:{
// Chart switching
type:['bar','line']
}
}
}, legend:{
data:[' Chinese language and literature ',' mathematics ']
}, xAxis:{
type:'category' ,// Taxonomic axis
data:xDataArr
}, yAxis:{
type:'value' ,// Value axis
}, series:[
{
name:' Chinese language and literature ',
type:'bar', //bar It's a histogram ,line It's linear ,pie It's pie shaped
data:yDaraArr1
},
{
name:' mathematics ',
type:'bar',
data:yDaraArr2
}
]
}
// step 5: Set the configuration item to echarts Instance object
mCharts.setOption(option)
</script>
</body>
</html>
General configuration refers to the configuration that can be used by any type of chart .
边栏推荐
- 14.绘制网络模型结构
- Several frequently used OCR document scanning tools | no watermark | avoid IQ tax
- Service mesh introduction, istio overview
- How does starfish OS enable the value of SFO in the fourth phase of SFO destruction?
- Su embedded training - Day6
- Two methods for full screen adaptation of background pictures, background size: cover; Or (background size: 100% 100%;)
- Marubeni official website applet configuration tutorial is coming (with detailed steps)
- A speed Limited large file transmission tool for every major network disk
- Chapter 16 intensive learning
- HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
猜你喜欢

How does starfish OS enable the value of SFO in the fourth phase of SFO destruction?

国内首次,3位清华姚班本科生斩获STOC最佳学生论文奖

Using GPU to train network model

7. Regularization application

10.CNN应用于手写数字识别

HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation

Service mesh introduction, istio overview

Jemter distributed

AI遮天传 ML-回归分析入门

Interface test advanced interface script use - apipost (pre / post execution script)
随机推荐
基于人脸识别实现课堂抬头率检测
【深度学习】AI一键换天
CVE-2022-28346:Django SQL注入漏洞
Ag9310 design USB type C to hdmi+u2+5v slow charging scheme design | ag9310 expansion dock scheme circuit | type-C dongle design data
14.绘制网络模型结构
USB type-C docking design | design USB type-C docking scheme | USB type-C docking circuit reference
New library online | information data of Chinese journalists
Recommend a document management tool Zotero | with tutorials and learning paths
Fofa attack and defense challenge record
Cs5212an design display to VGA HD adapter products | display to VGA Hd 1080p adapter products
3.MNIST数据集分类
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output
Su embedded training - Day6
Su embedded training - Day5
Invalid V-for traversal element style
12. RNN is applied to handwritten digit recognition
Codeforces Round #804 (Div. 2)(A~D)
How to transfer Netease cloud music /qq music to Apple Music
C#中string用法
Su embedded training - Day8