当前位置:网站首页>echart 写一个大屏展示圆边渐变柱状图
echart 写一个大屏展示圆边渐变柱状图
2022-04-21 21:53:00 【前端老实人】
效果如上图所示:
backgroundColor: "rgba(0,0,0,0)",
tooltip: {
show: true,
formatter: activeName.value == "电" ?"{b}:{c}kWh":"{b}:{c}m³",
},
grid: {
left: "5%",
top: "-6%",
right: "15%",
bottom: "8%",
containLabel: true,
},
xAxis: {
type: "value",
show: false,
position: "top",
axisTick: {
show: false,
},
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
splitLine: {
show: false,
},
},
yAxis: [
{
type: "category",
axisTick: {
show: false,
alignWithLabel: false,
length: 5,
},
splitLine: {
//网格线
show: false,
},
inverse: "true", //排序
axisLine: {
show: false,
lineStyle: {
color: "#fff",
},
},
data: [
activeName.value == "电"
? allyongdianTop5[0].mingzi
: allyongshuiTop5[0].mingzi,
activeName.value == "电"
? allyongdianTop5[1].mingzi
: allyongshuiTop5[1].mingzi,
activeName.value == "电"
? allyongdianTop5[2].mingzi
: allyongshuiTop5[2].mingzi,
activeName.value == "电"
? allyongdianTop5[3].mingzi
: allyongshuiTop5[3].mingzi,
activeName.value == "电"
? allyongdianTop5[4].mingzi
: allyongshuiTop5[4].mingzi,
],
// y轴坐标字体颜色以及大小
axisLabel: {
fontSize: 14,
textStyle: {
color: function (params, Index) {
// 标签国家字体颜色
var colorarrays = [
"#71A7FA",
"#41DDC7",
"#C96016",
"#71FA96",
"#6688D8",
];
return colorarrays[Index];
},
},
},
},
],
series: [
{
type: "bar",
label: {
normal: {
show: true,
position: "right",
formatter: activeName.value == "电" ? "{c}kWh" : "{c}m³",
textStyle: {
color: "#fff",
fontSize: "10",
},
},
},
itemStyle: {
normal: {
show: true,
color: function (params) {
let num = colorArray.length;
return {
type: "linear",
colorStops: [
{
offset: 0,
color: colorArray[params.dataIndex % num].bottom,
},
{
offset: 1,
color: colorArray[params.dataIndex % num].top,
},
],
};
},
barBorderRadius: 70,
borderWidth: 10,
},
},
barGap: "0%",
barCategoryGap: "60%",
data: [
activeName.value == "电"
? allyongdianTop5[0].value
: allyongshuiTop5[0].value,
activeName.value == "电"
? allyongdianTop5[1].value
: allyongshuiTop5[1].value,
activeName.value == "电"
? allyongdianTop5[2].value
: allyongshuiTop5[2].value,
activeName.value == "电"
? allyongdianTop5[3].value
: allyongshuiTop5[3].value,
activeName.value == "电"
? allyongdianTop5[4].value
: allyongshuiTop5[4].value,
],
},
],
版权声明
本文为[前端老实人]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_52691965/article/details/124324691
边栏推荐
- 我国工业互联网产业发展成效显著,但技术挑战仍是一项长期工程
- RFC 之间的关系
- redis配置文件详解
- docker MySQL定时备份
- 【C语言进阶9——指针的进阶(6)- 回调函数】
- In depth analysis of static, const, volatile, extern and register keywords
- 清洁机器人--红外下视传感器,检测是否存在地面距离突变的情形
- avformat_ new_ Stream understanding
- Redis高级:数据删除与淘汰策略、主从复制、哨兵模式、集群cluster、企业级解决方案
- 2022r1 quick opening pressure vessel operation certificate examination question bank simulation examination platform operation
猜你喜欢

Live555 learning

Unity3d C uses the offset of material map to realize the function of unlimited moving background effect of 2D game single background image (including source code)

Ffmpeg serial 3-video decoding

Online yaml to properties tool

RFC 之间的关系

Relationship between RFCs

Add subtitles to PR video

helm安装sonarqube(bitnami) 9.3
![[test case level definition]](/img/e8/a2c7dee5f76b6094ff8c39f33307fe.png)
[test case level definition]

Pay off 900000 housing loans to get the resignation certificate? Tencent response: inconsistent with the actual situation
随机推荐
Authing 正式加入 W3C 组织,将参与相关国际标准制定
WPF数据驱动修改绑定的方法
js实现公告自动滚动
Live555 learning
Common SQL optimization
数据库小练习
Mswep data NC format to TIF format
一加连发两款耳机产品:充电10分钟 听歌20小时
How does PHP add an array element to an array
ISMAR 2022 Journal Paper (TVCG)投稿交流
The @ select annotation is used in the mapper of mybtais, and the if annotation is used
Use try-with-resources or close this “FileOutputStream“
Lenovo announced the new progress of ESG: it promised that 100% of all computer products would contain recycled plastics by 2025
华云积极响应合肥高新区抗疫号召:践行社会责任 贡献科技企业力量
Nacos注册中心-服务注册与分级存储
2022 high altitude installation, maintenance and demolition of examination question bank and simulated examination
[C language advanced level 9 - pointer advanced level (6) - callback function]
01_交叉編譯Hello程序
2022 safety officer-b certificate operation certificate examination question bank and simulation examination
Workflow report setting customization development