当前位置:网站首页>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
边栏推荐
- DeNO 1.13.2 release
- Question brushing plan - depth first search (II)
- [leetcode sword finger offer 10 - II. Frog jumping steps (simple)]
- 亚马逊和Epic将入驻,微软应用商城向第三方开放
- Sequential state
- 2. Finishing huazi Mianjing -- 2
- How to play the guiding role of testing strategy
- ubutnu20安装CenterNet
- [leetcode refers to the two numbers of offer 57. And S (simple)]
- ros功能包内自定义消息引用失败
猜你喜欢
Flomo software recommendation
Chrome 94 introduces the controversial idle detection API, which apple and Mozilla oppose
Thinkphp5 + data large screen display effect
What if Jenkins forgot his password
Yolov5 NMS source code understanding
Deno 1.13.2 发布
Display, move, rotate
Question brushing plan - depth first search (II)
[leetcode refers to offer 47. Maximum value of gift (medium)]
C, print the source program of beautiful bell triangle
随机推荐
Yolov5 NMS source code understanding
mmap、munmap
Presto on spark supports 3.1.3 records
[※ leetcode refers to offer 32 - II. Print binary tree II from top to bottom (simple)]
Two Stage Detection
Factory mode
presto on spark 支持3.1.3记录
亚马逊和Epic将入驻,微软应用商城向第三方开放
Minecraft 1.12.2 module development (43) custom shield
DeNO 1.13.2 release
How to play the guiding role of testing strategy
thinkphp5+数据大屏展示效果
Addition, deletion, modification and query of MySQL advanced table
Thread safe sigleton (singleton mode)
Alibaba cloud responded to the disclosure of user registration information
[※ leetcode refers to offer 48. The longest substring without repeated characters (medium)]
一文解决浏览器跨域问题
setInterval、setTimeout、requestAnimationFrame
危机即机遇,远程办公效率为何会提升?
[leetcode refers to offer 18. Delete the node of the linked list (simple)]