首页 前端知识 Echarts 柱状图 设置柱状图渐变,设置柱状图圆角(弧度)

Echarts 柱状图 设置柱状图渐变,设置柱状图圆角(弧度)

2024-04-13 09:04:50 前端知识 前端哥 1012 772 我要收藏

Echarts 柱状图 设置柱状图渐变,设置柱状图圆角(弧度)

1. 效果截图

在这里插入图片描述

2. 配置项截图

在这里插入图片描述

3. 具体代码

import * as echarts from 'echarts'
// 项目组织项目数
const territoryOptions = {
key: 'territory',
title: {
text: '项目数',
textStyle: {
fontSize: 14
},
padding: [20, 32]
},
color: ['#A4CDEB', '#F2D378'],
legend: {
bottom: '10%'
},
tooltip: {
trigger: 'item',
formatter: '{b} : 数量{c}'
},
xAxis: [
{
type: 'category',
data: []
}
],
yAxis: [
{
type: 'value',
max: function(value) {
return Math.round((value.max + value.max * 0.4) / 10) * 10
}
}
],
dataZoom: {
startValue: 0,
endValue: 4,
type: 'slider',
height: '15px' // 高度设置,另外还有宽度
},
series: [
{
type: 'bar',
data: [],
barWidth: 30,
emphasis: {
barBorderRadius: 30
},
itemStyle: {
normal: {
barBorderRadius: 30,
label: {
show: true, // 开启显示
position: 'top', // 在上方显示
textStyle: {
// 数值样式
color: '#6E7079',
fontSize: 14
}
},
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#51e7ff' }, // 底部柱图渐变色
{ offset: 1, color: '#05a6ff' } // 顶部柱图渐变色
])
}
}
}
]
}
复制
转载请注明出处或者链接地址:https://www.qianduange.cn//article/4856.html
标签
评论
还可以输入200
共0条数据,当前/页
发布的文章

JQuery中的load()、$

2024-05-10 08:05:15

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!