You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/11/02 06:57:38 UTC

[GitHub] [echarts] Songshuangshuang edited a comment on issue #5972: Markline文字与Y轴文字重叠,有多条Markline时,线条与文字也会重叠,导致看不清楚

Songshuangshuang edited a comment on issue #5972:
URL: https://github.com/apache/echarts/issues/5972#issuecomment-957073025


   我在使用柱状图时也遇到了同样的问题,双坐标轴markline右侧与右侧y轴重叠导致看不清楚。尝试了修改markline的长度、偏移量都没效果,最后使用其他方式pollyfill了,即隐藏掉markline的文案,设置自定义tooltip,加上markline的值,这样hover上去就会显示当前的markline的值,与其他节点的交互一致。
   <img width="640" alt="wecom-temp-b5d4fd6b63814a95bc89f8b9369dbb76" src="https://user-images.githubusercontent.com/35681192/139799982-7b745191-4891-44cb-9afd-44dc6f09687b.png">
   配置如下
   // 隐藏markline右侧文案
   markLine: {
                       data: [{ type: 'average', yAxis: 30 }],
                       label: {
                         show: false,
                       },
                       lineStyle: {
                         color: '#1890ff',
                       },
                     },
   //自定义tooltip
   tooltip: {
                   trigger: 'axis',
                   formatter: () => {
                     return `
                       点击数:70<br>
                       唤起率:20%<br>
                       <span  style="color: #1890ff">基线:30%</span>
                    `;
                   },
                 },
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org