Skip to content

Support negative y axes in line and bar charts#7401

Merged
henon merged 2 commits intoMudBlazor:devfrom
chausner:charts-negative-axes
Aug 22, 2023
Merged

Support negative y axes in line and bar charts#7401
henon merged 2 commits intoMudBlazor:devfrom
chausner:charts-negative-axes

Conversation

@chausner
Copy link
Contributor

@chausner chausner commented Aug 21, 2023

Description

This extends the line chart and bar chart implementations to support negative y values.

Fixes #6810

How Has This Been Tested?

The existing unit tests for line and bar chart have been updated to include negative values.
Further, the sample charts on the unit test viewer have been updated to include negative values, and the resulting charts have been tested visually.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Before

image image

After

image image

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Aug 21, 2023
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 91.66% and project coverage change: -0.01% ⚠️

Comparison is base (47a1372) 90.59% compared to head (6223e41) 90.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7401      +/-   ##
==========================================
- Coverage   90.59%   90.58%   -0.01%     
==========================================
  Files         427      427              
  Lines       15176    15188      +12     
==========================================
+ Hits        13748    13758      +10     
- Misses       1428     1430       +2     
Files Changed Coverage Δ
src/MudBlazor/Components/Chart/Charts/Bar.razor.cs 94.89% <86.95%> (-1.85%) ⬇️
...rc/MudBlazor/Components/Chart/Charts/Line.razor.cs 98.43% <100.00%> (+0.07%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro requested a review from henon August 21, 2023 22:28
Copy link
Member

@ScarletKuro ScarletKuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ScarletKuro
Copy link
Member

Could you add a image / gif that demonstrates how it looks on the chart?

@chausner
Copy link
Contributor Author

Could you add a image / gif that demonstrates how it looks on the chart?

Sure, I have added screenshots in the original post.

@henon henon merged commit a923b92 into MudBlazor:dev Aug 22, 2023
@henon
Copy link
Contributor

henon commented Aug 22, 2023

Thanks!

@chausner chausner deleted the charts-negative-axes branch October 15, 2023 13:45
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
* Support negative y axes in line and bar charts

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

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudChart Line cannot handle negative y values

3 participants