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.
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
improvements in barRect height calculation #3650
improvements in barRect height calculation #3650
Changes from 6 commits
e2fa55b
ed9d70d
6cbecb8
526a73a
4548474
59d6986
c774d20
1b6cc38
daff645
a77a358
b67c251
9a9edcb
bf86f2c
f69c6ee
ce578a0
afac36e
b57cd0b
0e7ff42
104c0c4
e6098f3
76b1f6f
d5d9abd
8da5272
8ae48b9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what you think if we use
min = 0.5 * max
andmax = 1.5 * min
? @potato04 @jjatie @petester42 ?clearly if min > max, and user only set one custom value of them, +/- 1 is not always the good value, for example with large values and decimals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't agree more, may be we should update those codes too
https://github.com/danielgindi/Charts/blob/a77a358fb0d8a89b6121d4cdcbc122cc42cce395/Source/Charts/Components/YAxis.swift#L170-L178
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the min/max correction is not perfect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at first I was thinking a fix like this:
I think there is a chance when
offsetAxis._customAxisMin
istrue
, andoffsetAxis._customAxisMax
isfalse
, you still need to setoriginYOffset
. Like all negative values?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some debugging, it seems that the value of _customAxisMax/_customAxisMin has nothing to do with calculating offset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really? As the old commit said, if you touch nothing, the bar will draw from zero. So it does not need any offset. I will check the edge