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

MudChart: Add TimeSeries line and area chart components #8973

Merged
merged 13 commits into from
May 21, 2024

Conversation

radderz
Copy link
Contributor

@radderz radderz commented May 15, 2024

Description

Adding a time series version of charts and implementing support for areas and lines to coexist on it. It reused a large amount of the existing line chart code with the changes needed to support time series and area charts. The same approach could be used to make the non time series chart support an area style.

How Has This Been Tested?

Manually tested the created charts and added a docs page.

Type 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)
  • Documentation (fix or improvement to the website or code docs)

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.

…axes

add new TimeSeries chart type that can render line or area series along a datetime time x-axis
… is only on the line section and not around the whole shape.
@github-actions github-actions bot added enhancement New feature or request PR: needs review labels May 15, 2024
@radderz
Copy link
Contributor Author

radderz commented May 15, 2024

#8973

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 90.16393% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 90.50%. Comparing base (28bc599) to head (24f51bb).
Report is 216 commits behind head on dev.

Files Patch % Lines
...Blazor/Components/Chart/Charts/TimeSeries.razor.cs 92.63% 7 Missing and 5 partials ⚠️
src/MudBlazor/Components/Chart/MudChart.razor.cs 33.33% 3 Missing and 1 partial ⚠️
...MudBlazor/Components/Chart/Charts/TimeSeries.razor 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8973      +/-   ##
==========================================
+ Coverage   89.82%   90.50%   +0.67%     
==========================================
  Files         412      397      -15     
  Lines       11878    12317     +439     
  Branches     2364     2399      +35     
==========================================
+ Hits        10670    11148     +478     
+ Misses        681      631      -50     
- Partials      527      538      +11     

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

@henon
Copy link
Collaborator

henon commented May 15, 2024

image

The two sections have identical text. I'd suggest removing the area usage section and just add a MudSwitch to the basic usage example to switch between line and area.

@radderz
Copy link
Contributor Author

radderz commented May 20, 2024

The two sections have identical text. I'd suggest removing the area usage section and just add a MudSwitch to the basic usage example to switch between line and area.

I have squashed it down into a single chart with multiple series.

@henon
Copy link
Collaborator

henon commented May 20, 2024

Nice, can you post an updated screenshot please?

@radderz
Copy link
Contributor Author

radderz commented May 20, 2024

Nice, can you post an updated screenshot please?

edited the first post to reflect

<SectionHeader Title="Basic Usage">
<Description>
To get a Line Chart use <CodeInline>Type="TimeSeriesDiplayType.Line"</CodeInline> to render the configured <CodeInline>TimeSeriesChartSeries</CodeInline> as a line graph.
To get an Area Chart use <CodeInline>Type="TimeSeriesDiplayType.Area"</CodeInline> to render the configured <CodeInline>TimeSeriesChartSeries</CodeInline> as a area graph.
Copy link
Collaborator

Choose a reason for hiding this comment

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

small typo, should be: as an area graph

Copy link
Collaborator

@henon henon left a comment

Choose a reason for hiding this comment

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

Good to merge. Just for my understanding @radderz, what is the reason for introducing the MudCategoryChartBase?

@henon henon changed the title Timeseries line and area chart components MudChart: Add TimeSeries line and area chart components May 21, 2024
@henon henon merged commit 2468773 into MudBlazor:dev May 21, 2024
4 checks passed
@ScarletKuro
Copy link
Member

I think it was merged a bit too early, as it missing explicit bUnit tests which is required by our rules.
It will be harder to migrate to generic math without worrying about that something got broken.

@henon
Copy link
Collaborator

henon commented May 22, 2024

Sorry, I forgot to check for tests :(. Shall we revert and wait for resubmission with tests or will you PR the tests separately @radderz ?

@radderz
Copy link
Contributor Author

radderz commented May 22, 2024

Good to merge. Just for my understanding @radderz, what is the reason for introducing the MudCategoryChartBase?

Basically MudCategoryChartBase is the old MudChartBase and and moved the common parts for the time series to a new MudChartBase, MudCategoryChartBase was all I could think of naming wise for the existing charts that are based on category/value.

@radderz
Copy link
Contributor Author

radderz commented May 22, 2024

Sorry, I forgot to check for tests :(. Shall we revert and wait for resubmission with tests or will you PR the tests separately @radderz ?

I hadn't planned on doing tests for the timeseries, but based on the line series tests if it basically just did a single chart of each and checked the result matches a known value that'd be straight forward I guess.

I don't have time to do this right now but I will do another PR to add the tests if no one has done it in the next few weeks.

@ScarletKuro
Copy link
Member

if it basically just did a single chart of each and checked the result matches a known value that'd be straight forward I guess.

That would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants