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 2020/07/23 13:36:28 UTC

[GitHub] [incubator-echarts] LiZ2z opened a new issue #13017: 关于笛卡尔坐标系X轴labe间隔算法问题

LiZ2z opened a new issue #13017:
URL: https://github.com/apache/incubator-echarts/issues/13017


   ### Version
   4.8.0
   
   ### Steps to reproduce
   我需要在项目中实现如下x轴效果:
   ```
   --------------------------------  x轴线
        长
        名
        字
        .
        .
        .
   ```
   
   formatter是这样的:
   ```
   formatter: (text)=>{ 
       return `${text.split('').join('\n')}{ellipsis|.\n.\n.}`
   }
   ```
   如果让竖直的**...**的行高与普通文本一致,显然会很丑陋,所以我需要通过rich来修改它们的行高,让它们靠的近一些。
   
   此时问题就来了,在计算label间距的函数`calculateCategoryInterval`中,是将formtter返回值当作普通文本直接检测(可能是为了性能?),而不是将rich解析出来再检测:
   
   ```
   var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top');
   
   // 正确的宽度检测            实际(但错误)的宽度检测
   // ------------------------------------------
   //     x                                 x
   //     x                                 x{ellipsis.
   //     .                                  .
   //     .                                  .
   //     .                             
   ```
   
   这就导致了主观上应该密集的label间隔因为错误的检测方式变得稀疏
   
   下面两种实现,主观上label间隔应该相同
   ![image](https://user-images.githubusercontent.com/30578440/88292560-5cf47080-cd2c-11ea-9960-d576359333d1.png)
   ![image](https://user-images.githubusercontent.com/30578440/88292631-785f7b80-cd2c-11ea-816a-a09b7b85a0e4.png)
   
   
   ### What is expected?
   优化宽度检测算法。或者能有什么其他实现?
   
   ### What is actually happening?
   宽度检测算法错误
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   


----------------------------------------------------------------
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.

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


[GitHub] [incubator-echarts] susiwen8 commented on issue #13017: 关于笛卡尔坐标系X轴labe间隔算法问题

Posted by GitBox <gi...@apache.org>.
susiwen8 commented on issue #13017:
URL: https://github.com/apache/incubator-echarts/issues/13017#issuecomment-665530210


   @LiZ2z That's not a problem, many contributor started with knowing absolute nothing about ECharts, please give it a try 


----------------------------------------------------------------
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.

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


[GitHub] [incubator-echarts] LiZ2z commented on issue #13017: 关于笛卡尔坐标系X轴labe间隔算法问题

Posted by GitBox <gi...@apache.org>.
LiZ2z commented on issue #13017:
URL: https://github.com/apache/incubator-echarts/issues/13017#issuecomment-664843246


   > We are having some big progress on label position in `next` branch, which we anticipate to be released alpha version at end of this month, It would be great that you can contribute some idea to this.
   
   很高兴被邀请!但是我刚刚使用echarts没多久,恐怕不能给出更多有效的建议。


----------------------------------------------------------------
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.

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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #13017: 关于笛卡尔坐标系X轴labe间隔算法问题

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #13017:
URL: https://github.com/apache/incubator-echarts/issues/13017#issuecomment-663011137


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
   
   If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


----------------------------------------------------------------
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.

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