apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.21k stars 19.6k forks source link

柱状图横坐标字符串很长如何截取才不会让数据错位?? #8102

Closed wuranhw closed 3 years ago

wuranhw commented 6 years ago

One-line summary [问题简述]

我最近在项目组开发过程中遇到这样一个场景: 1)用到echarts4.0版本bar做柱状图,横坐标代表系统监视员名字,是最长255个字符的名字 那么排版上怕排布不下,所以想截取16个字符+'...'这样的方式展示,全名在点击柱状图时用悬浮tip字符串模板体现出来 但是这样会有个问题,数据还能正确映射到y轴的值吗? 有谁知道咋个截取吗?谢谢

Version & Environment [版本及环境]

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

option = {

}

Other comments [其他信息]

emloxe commented 6 years ago

问题解决了吗?可否提供一下思路

territoryfan commented 5 years ago

@wuranhw ,可以鼠标移入 文字 ,显示完整 https://github.com/territoryfan/echarts

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.