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/12/29 08:22:55 UTC

[GitHub] [echarts] pissang opened a new pull request #16300: [Feature] [axis] add alignTicks for mutliple axis alignment.

pissang opened a new pull request #16300:
URL: https://github.com/apache/echarts/pull/16300


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [x] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   This PR adds `alignTicks` option to allow ticks alignment between multiple value or log axis.
   
   Similar PR: https://github.com/apache/echarts/pull/13210
   
   ### How it Works
   
   When a value/log axis is set to `alignTicks: true`. It will find the first value/log axis on the same dimension that is not use `alignTicks` and align the ticks to it. The align algorithm is bacially from radar series, which already has ticks alignment between multiple indicator axis, with some enhancement on the corner cases. Here is a simple explanation:
   
   1. Get the ticks number of axis align to. The `splitNumber` is `ticksNumber - 1`
   2. Calculate `extent` and `interval` with this `splitNumber` using `calcNiceExtent`.
   3. The calculated ticks is not excatly same to the target number. So we need an extra refine step, the refine step will consider four cases:
       + If `min` and `max` are both fixed. It will simply calculate the `interval` by `(max - min) / splitNumber`
       + If `max` is fixed. Try to calculate `min` by `max - interval * splitNumber`. `interval` is from the second step. If the calculated `min` is larger than the minimal value. Increase interval util `min` is less than the minimal value.
       + If `min` is fixed. Similar to `max` fixed case. 
       + If both `min` and `max` are not fixed. Set `max` to `extent[1]` calculated from the second step. Then it's similar to the `max` fixed case. Note if the calculated `min` and `max` cross the zero value. We need to check if the data extent cross and make sure they are both positive or negative.
   4. If the axis align to has set `min` or `max`. We need to adjust the calculated `min` and `max` proportionally.
   
   
   
   ### Limitations
   
   1. Time axis is not supported yet because the ticks calculation has becoming really complex since 5.0
   2. Using `alignTicks` with complex `min`, `max` value, e.g. `'dataMin'`, `'dataMax'`, will lead to unreadable ticks.
   
   
   ### Fixed issues
   
   https://github.com/apache/echarts/issues/11390
   https://github.com/apache/echarts/issues/10928
   
   ## Details
   
   ### Before: What was the problem?
   
   ![image](https://user-images.githubusercontent.com/841551/147641667-3a7f272f-ed5d-4be6-a631-b39d5bb7b883.png)
   
   ### After: How is it fixed in this PR?
   
   ![image](https://user-images.githubusercontent.com/841551/147641612-0f6bf3dd-59e5-4bb4-a2cb-96ba1aab6f36.png)
   
   
   ### More conformance tests
   
   ![image](https://user-images.githubusercontent.com/841551/147641796-0606535f-6b25-4aec-92e5-fb580705ff4d.png)
   
   
   ## Misc
   
   <!-- ADD RELATED ISSUE ID WHEN APPLICABLE -->
   
   - [x] The API has been changed (apache/echarts-doc#xxx).
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   


-- 
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] echarts-bot[bot] commented on pull request #16300: [Feature] [axis] add alignTicks for mutliple axis alignment.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #16300:
URL: https://github.com/apache/echarts/pull/16300#issuecomment-1003061963


   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


-- 
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] echarts-bot[bot] commented on pull request #16300: [Feature] [axis] add alignTicks for mutliple axis alignment.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #16300:
URL: https://github.com/apache/echarts/pull/16300#issuecomment-1002453276


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.
   
   Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/apache/echarts-doc) for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the `PR: awaiting doc` label.


-- 
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] maxdor1 edited a comment on pull request #16300: [Feature] [axis] add alignTicks for mutliple axis alignment.

Posted by GitBox <gi...@apache.org>.
maxdor1 edited a comment on pull request #16300:
URL: https://github.com/apache/echarts/pull/16300#issuecomment-1043286428


   Hi
   
   I can't build an online example because my data is sensitive but here is a screenshot showing that the last right axis min is not calculated correctly:
   
   ![image](https://user-images.githubusercontent.com/45298226/154548086-388c1b93-63e6-45b4-b989-94fefe299013.png)
   
   Min value of this dataset is 58.854 but the min axis tick shows as 58.86
   


-- 
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] maxdor1 commented on pull request #16300: [Feature] [axis] add alignTicks for mutliple axis alignment.

Posted by GitBox <gi...@apache.org>.
maxdor1 commented on pull request #16300:
URL: https://github.com/apache/echarts/pull/16300#issuecomment-1043286428


   Hi
   
   I Can't build an example with because my data is sensitive but here is a screenshot showing that the last right axis min is not calculated correctly:
   
   ![image](https://user-images.githubusercontent.com/45298226/154548086-388c1b93-63e6-45b4-b989-94fefe299013.png)
   
   Min value of this dataset is 58.854 but the min axis tick shows as 58.86
   


-- 
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] pissang merged pull request #16300: [Feature] [axis] add alignTicks for mutliple axis alignment.

Posted by GitBox <gi...@apache.org>.
pissang merged pull request #16300:
URL: https://github.com/apache/echarts/pull/16300


   


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