当前位置:网站首页>Echerts add pie chart random color
Echerts add pie chart random color
2022-04-23 21:25:00 【Sister Chunfeng】
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [
120,
200,
150,
80,
70,
110,
130
],
// Random color
// itemStyle: {
// normal: {
// color:function(){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
// },
// },
// Assign colors
itemStyle: {
normal: {
color: function(params) {
var colorarrays = ['#0769CB', '#00ABBD', '#ffd886', "#9F2E61", "#4D670C",'#0769CB', '#00ABBD'];
return colorarrays[params.dataIndex];
}
}
},
type: 'bar'
}
]
};
版权声明
本文为[Sister Chunfeng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/110/202204200620163682.html
边栏推荐
- Amazon and epic will be settled, and the Microsoft application mall will be opened to third parties
- Normalized transforms in pytorch The real calculation process of normalize
- go defer
- 2.整理华子面经--2
- 41. The first missing positive number
- Deep analysis of C language pointer (Part I)
- Pytorch preserves different forms of pre training models
- C, print the source program of beautiful bell triangle
- Thread safe sigleton (singleton mode)
- wait、waitpid
猜你喜欢
Deno 1.13.2 发布
Plato Farm元宇宙IEO上线四大,链上交易颇高
亚马逊和Epic将入驻,微软应用商城向第三方开放
go interface
管道和xargs
Deep understanding of modern mobile GPU (continuously updating)
Opencv application -- jigsaw puzzle
Common commands of MySQL in Linux
Sharpness difference (SD) calculation method of image reconstruction and generation domain index
小米手机全球已舍弃“MI”品牌,全面改用“xiaomi”全称品牌
随机推荐
ubutnu20安装CenterNet
Keras. Layers introduction to various layers
Zhongchuang storage | how to choose a useful distributed storage cloud disk
ubutnu20安裝CenterNet
引入结构化并发,Swift 5.5 发布!
Pytorch preserves different forms of pre training models
Introduce structured concurrency and release swift 5.5!
亚马逊和Epic将入驻,微软应用商城向第三方开放
[leetcode refers to offer 18. Delete the node of the linked list (simple)]
Selenium displays webdriverwait
Selenium 显示等待WebDriverWait
[leetcode refers to offer 42. Maximum sum of continuous subarrays (simple)]
Question brushing plan - depth first search (II)
Opencv reports an error. Expected PTR < CV:: UMAT > for argument '% s'‘
小米手机全球已舍弃“MI”品牌,全面改用“xiaomi”全称品牌
DeNO 1.13.2 release
Xiaomi mobile phone has abandoned the "Mi" brand all over the world and switched to the full name brand of "Xiaomi"
[leetcode refers to offer 22. The penultimate node in the linked list (simple)]
3-5 obtaining cookies through XSS and the use of XSS background management system
Resolve the "chromedriver executable needs to be in path" error