Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bar): Fixing a missing bar in log scaled stack. close 19517 #19518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kawsndriy
Copy link

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

This change fixes a log scale of stacked bar chart - where some rectangles were getting Infinite height due to the log.

Fixed issues

Details

Before: What was the problem?

image

After: How does it behave after the fixing?

After the fix, the bar is rendered as expected.

image

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • 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

Copy link

echarts-bot bot commented Jan 17, 2024

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

@admsev
Copy link

admsev commented May 25, 2024

@gooroodev review

@gooroodev
Copy link

1. Summary of Changes

This pull request addresses an issue with missing bars in a log-scaled stacked bar chart. The changes include:

  • Adjusting the start value for the base coordinate calculation when the value is zero in a logarithmic axis.
  • Adding a test case in bar-log.html to verify that stacked bars are correctly rendered in a log-scaled chart.

2. Issues, Bugs, or Typos

Code Issues

  • Missing Newline at End of File: The modified bar-log.html file does not end with a newline, which is a common convention in many coding standards.

Proposed Improvements

Improvement 1: Add Newline at the End of File

@@ -123,4 +123,4 @@
     </body>
-</html>
\ No newline at end of file
+</html>

3. General Review of Code Quality and Style

  • Code Quality: The code is well-structured and addresses the specific issue of missing bars in log-scaled stacked bar charts. The logic for adjusting the start value to avoid -Infinity in logarithmic calculations is sound.
  • Code Style: The code follows a consistent style, and comments are added to explain the rationale behind the changes, which enhances readability.
  • Testing: The addition of a new test case in bar-log.html is a good practice to ensure that the changes work as expected and to prevent future regressions.

Specific Comments:

  • Handling Logarithmic Zero: The approach to adjust startValue to 1 when it is zero is a practical solution to handle the issue of log(0). The comment explaining this adjustment is clear and helpful.
  • Test Case: The new test case in bar-log.html is well-constructed and verifies the correct rendering of stacked bars in a log-scaled chart. It checks for both the presence of bars and their stacking behavior.

Overall, the changes are well-implemented and address the issue effectively. Once the newline issue is resolved, this pull request should be ready for merging.

Yours, Gooroo.dev. To receive reviews automatically, install Github App

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants