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 2022/06/06 10:01:49 UTC

[GitHub] [echarts] sverbach opened a new issue, #17162: [Bug] horizontal margin (distance) in vertical marklines not working

sverbach opened a new issue, #17162:
URL: https://github.com/apache/echarts/issues/17162

   ### Version
   
   5.3.2
   
   ### Link to Minimal Reproduction
   
   https://codepen.io/sverbach2/pen/PoQByvW
   
   ### Steps to Reproduce
   
   1. Load the codepen
   2. Search for the label "I should have x-offset" in the chart
   3. This label should have an offset of 30px, but none is applied
   Note that issue only seems to appear when using vertical marklines, I do not encounter this issue on horizontal nor 2d-marklines.
   
   ### Current Behavior
   
   X-value of the `distance` property is not applied when using vertical marklines.
   E.g. `distance: [30, 10]` applies a 10px y-margin but 0px x-margin. 
   
   ### Expected Behavior
   
   I would expect to be able to apply x- and y-distance on my markline labels.
   E.g. `distance: [30, 10]` applies a 10px y-margin and 30px x-margin. 
   
   ### Environment
   
   ```markdown
   - OS: Windows 11, Windows 10
   - Browser: Brave 1.39.111, Chrome 102.0.5005.63, Firefox 101.0, 
   - Framework: None
   ```
   
   
   ### Any additional comments?
   
   When using any other type of marklines (other than vertical ones), this bug will not occur.


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #17162: [Bug] horizontal label margin (distance) in vertical marklines not working

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

   This issue is labeled with `difficulty: easy`.
   @sverbach Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.
   
   Please have a look at [How to debug ECharts](https://github.com/apache/echarts/blob/master/CONTRIBUTING.md#how-to-debug-echarts) if you'd like to give 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.

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


[GitHub] [echarts] jiawulin001 commented on issue #17162: [Bug] horizontal label margin (distance) in vertical marklines not working

Posted by GitBox <gi...@apache.org>.
jiawulin001 commented on issue #17162:
URL: https://github.com/apache/echarts/issues/17162#issuecomment-1156058183

   ### Conclusion
   `distance` and `offset` has almost the same function and `offset` works well with any direction. I would suggest use `offset` only and delete `distance` as an API for user.
   Of course if you want to know why problem exists for `distance`, keep reading.
   
   <details>
   <summary>
   Problem Location
   </summary>
   
   The place where the position of label is determined is as followed:
   https://github.com/apache/echarts/blob/11a9247e7fab2e6ff9c60b545ba775e8c1b2412f/src/chart/helper/Line.ts#L449-L454
   Here `distanceX/Y` is literally the user-specified `distance` and they are multiplied by `d[0]/d[1]`. `d` is derived here:
   https://github.com/apache/echarts/blob/11a9247e7fab2e6ff9c60b545ba775e8c1b2412f/src/chart/helper/Line.ts#L365-L366
   `toPos` and `fromPos` is the starting point and ending point of the line and `d` means whether they have differences on x or y coordinates. For example, d=[0,1] if the line is parallel to y axis and point at positive direction. Now that explains why `distanceX` won't work at `label.x` because d[0] = 0 and it deactivate the effect of `distanceX`.
   </details>
   
   I would submit a PR to **either delete the `distance` API, or fix `distance` API**. I consider the former one better because these two APIs are functionally replicate.
   
   


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


[GitHub] [echarts] Ovilia commented on issue #17162: [Bug] horizontal label margin (distance) in vertical marklines not working

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17162:
URL: https://github.com/apache/echarts/issues/17162#issuecomment-1148135009

   This seems to be a bug.


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