Repository navigation
feat: charts for MAUI and Avalonia - #23
Merged
Merged
Conversation
Chart1 to Chart5 in both themes, on MAUI and Avalonia and in the theme resource file, converted from ShellUI's --chart-1 to --chart-5. The charts take their series colors from them. This changes the shell utility: a project whose shell came from an older CLI version needs `shellui-native update shell` before it adds a chart.
Bar, line, area, pie, donut, radar and radial charts, drawn by the components themselves (MAUI's GraphicsView, Avalonia's Render) with no charting package. - chart: the shared core. The series model, axes with rounded tick values, the legend, a tooltip under the pointer, a grow-in animation, and a small canvas interface each platform implements. - bar-chart: grouped, stacked or horizontal bars, with negative values. - line-chart: smooth or straight lines, with optional dots. - area-chart: overlapping or stacked areas. - pie-chart: PieChart and DonutChart, with a value and label in the hole. - radar-chart: a shape per series on a ringed grid. - radial-chart: concentric progress rings with a centre value. Series and labels can be written in XAML as comma-separated lists. Charts redraw when their data or the theme changes. The drawing code is the same on both platforms: curves and arcs are turned into points, so a canvas only draws lines, polygons and text. Not included: zoom and pan, mixed bar and line charts, and click events on a bar or slice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a chart family for MAUI and Avalonia, drawn by the components themselves (MAUI's
GraphicsView, Avalonia'sRender) with no charting package.Changes
Theme
ShellToken.Chart1–Chart5in both themes, on MAUI and Avalonia and in the theme resource file, converted from ShellUI's--chart-1–--chart-5. Charts take their series colors from themCharts
chart: shared core used by every chart: series model, axes with rounded tick values, legend, tooltip under the pointer, 600 ms grow-in animation, redraw on data or theme change, and a small canvas interface each platform implementsbar-chart: grouped, stacked or horizontal bars, negative valuesline-chart: smooth or straight lines, optional dotsarea-chart: overlapping or stacked areaspie-chart: PieChart and DonutChart, with a value and label in the holeradar-chart: a shape per series on a ringed gridradial-chart: concentric progress rings with a center valueValues="1, 2, 3")Also
chartUpgrade note
This changes
shell. A project whose shell came from an older CLI version needsshellui-native update shellbefore it adds a chart. This goes into the next release notes, withupdate button(for button-group) andupdate calendar(for date-range-picker).Verification
dotnet formatcheck cleanbar-chartalone,radial-chartalone and all seven together in a fresh Avalonia app, and all seven in a freshdotnet new mauiapp (Windows), build 0/0IsAnimated="False"draws at onceNot included
Not tested