Skip to content

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

Closed
kawsndriy wants to merge 1 commit into
apache:masterfrom
kawsndriy:master
Closed

fix(bar): Fixing a missing bar in log scaled stack. close 19517#19518
kawsndriy wants to merge 1 commit into
apache:masterfrom
kawsndriy:master

Conversation

@kawsndriy

Copy link
Copy Markdown

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

@echarts-bot

echarts-bot Bot commented Jan 17, 2024

Copy link
Copy Markdown

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

admsev commented May 25, 2024

Copy link
Copy Markdown

@gooroodev review

@gooroodev

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR. We are sorry for this but 2 years is a long time and the code base has been changed a lot. Thanks for your contribution anyway.

@github-actions github-actions Bot added the stale Inactive for a long time. Will be closed in 7 days. label May 25, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This PR has been automatically closed because it has not had recent activity. Sorry for that and we are looking forward to your next contribution.

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

Labels

PR: doc unchanged PR: first-time contributor size/XS stale Inactive for a long time. Will be closed in 7 days.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants