当前位置:网站首页>Echart: category text position adjustment of horizontal histogram
Echart: category text position adjustment of horizontal histogram
2022-06-28 19:34:00 【@I don't know you】
Preface
echarts The horizontal histogram of is also quite common , But the category text is basically on the left , such as :
But you can always trust your project manager or product manager to get you into trouble , For example, it is shown to customers ui chart , The text is above :
It's OK to negotiate with some talkative customers , But some customers ... The last thing we are forced to do is to develop .
Text
Can this effect be achieved ? Although I have never seen anything like it , But it can really be realized .
Code
option = {
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
axisLabel: {
show: false },
data: ['abc', 'abcdefgh']
},
series: [
{
name: 'Cost',
type: 'bar',
label: {
show: true,
formatter: '{b}',
position: 'left',
align: 'left',
offset: [10, -20]
},
barWidth: 20,
data: [10, 20]
}
]
};
design sketch 
Be careful :
1、 stay yAxis Must be added in axisLabel: { show: false }, , Otherwise, there will be two categories , such as :

2、series in label Property configuration for ( The key )
label: {
show: true,
formatter: '{b}',
position: 'left',
align: 'left',
offset: [10, -20]
},
show: true,Show category textposition: 'left',Set toleft, At first, the direction was wrong and it was set totop, Wasted a lot of timealign: 'left',Set text alignment , You have to set , Otherwise, the text position will be inconsistentoffset: [10, -20]Offset , The first is lateral offset ; The second is the vertical offset . The first one is based on the actual situation , The second suggested absolute value is equal tobarWidth( Width of column )
边栏推荐
- 多测师肖sirapp中riginal error: Could not extract PIDs from ps output. PIDS: [], Procs: [“bad pid
- Paper 3 vscode & texlive & sumatrapdf create a perfect tool for writing papers
- Idea merge other branches into dev branch
- jvm内存结构
- matlab 受约束的 Delaunay 三角剖分
- F (x) construct the equation, calculate the partial derivative by gradient descent, determine the partial derivative adjustment by loss function, and deal with nonlinear problems by activation functio
- 颜色渐变的FontAwesome图标
- C语言-函数知识点
- SQL Server2019 新建 SQL Server身份验证用户名 并登录
- 直播app系统源码,动态遇到视频时开始自动播放
猜你喜欢

Grafana biaxial graph with your hands

The white paper on the panorama of the digital economy and the digitalization of consumer finance were released

How does redis implement inventory deduction? How to prevent oversold?

Group programming TIANTI competition exercise - continuously updating

Installation and configuration of CGAL in PCL environment 5.4.1

Building tin with point cloud

《数字经济全景白皮书》消费金融数字化篇 重磅发布

腾讯汤道生:面向数实融合新世界,开发者是最重要的“建筑师”

rancher增加/删除node节点

严重性 代码 说明 项目 文件 行 禁止显示状态 错误 C1047 对象或库文件“.lib”是使用与其他对象(如“x64\Release\main.obj”)不同的
随机推荐
Kaggle gastrointestinal image segmentation competition baseline
智能计算系统3 Plugin 集成开发的demo
SQL interview question: find the maximum number of consecutive login days
The amazing nanopc-t4 (rk3399) is used as the initial configuration and related applications of the workstation
从设计交付到开发,轻松畅快高效率!
智能计算系统1 环境搭建
Get the timestamp of 0:00 and 23:59 of the current date
使用点云构建不规则三角网TIN
i人事HR系统上架企业微信ISV,增强企微在服务连锁零售等行业深度应用
MDM data analysis function description
大火的虚拟人在哪些产业开始发力?
Question brushing analysis tool
How to change the status bar at the bottom of win11 to black? How to change the status bar at the bottom of win11 to black
Kaggle腸胃道圖像分割比賽baseline
机器学习笔记 temperature+Softmax
Why is it not enough to declare the structure alias when using the structure variable of other files in C language, and the proper name must be used? (cannot add struct when using alias)
C#连接数据库完成增删改查操作
From design delivery to development, it is easy and efficient!
Building tin with point cloud
数论 --- 欧拉函数、筛法求欧拉函数、欧拉定理、费马小定理详细证明