Draw LineChart entirely on Canvas, including indicators and labels#164
Open
brayellison wants to merge 2 commits intoehsannarmani:masterfrom
Open
Draw LineChart entirely on Canvas, including indicators and labels#164brayellison wants to merge 2 commits intoehsannarmani:masterfrom
brayellison wants to merge 2 commits intoehsannarmani:masterfrom
Conversation
… canvas instead of delegating to composables cleanup required, but it's working general cleanup, remove unused, apply formatting bugfix: coerce to inset bounds, check before `showPopup` unnecessary remove draw grid in favor of calculated heights/widths of indicators/labels, add `drawTicks`, use ticks passed from `insetDrawScope` within `LineChartCanvas`. Added test cases to initial chart in `PhoneSample` couple fixes fix errors after removing dividerProperties
ba2e51f to
968e96a
Compare
…djust inset calculation to avoid crash on screen orientation change change `clipRect` to just on the paths, avoids clipping dots on the boundary, cleanup refactor `Bounds` and `InsetPad` into utilities, add handling of label rotation update `PhoneSample` with label rotation fix imports
55daaf1 to
becd496
Compare
Author
Author
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.

The idea is that drawing the indicators and labels directly on the canvas opens up many additional features:
Before:

After:

I started out updating this for personal use, but I thought it might be helpful for the project overall.
One more thing that does need to be looked at, the rotation of the labels was removed. It shouldn't be difficult to add that back in within this framework though.
Let me know if there's anything else you'd like to see.