-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Bar Chart Value Labels missing #5135
Comments
Same issue here. It happens randomly. I've tried changing constraints, font sizes, leftAxis spaceTop/spaceBottom and nothing consistently works. Charts 3.2.2 iPhone 11 Pro Simulator |
Please help us. Thanks @danielgindi |
are you able to debug a little? it seems you could do this. normally just search for the value labels and see whether it goes into drawText. is it only happens on mac? |
Hi @liuxuan30 I may find some time to debug. But not in the near future. But it happens in iOS as well. Like I said it's easier to replicate on Mac. On iOS it's a lottery. They can disappear depending what negative values you have. May disappear in portrait but not landscape and vice versa. You should be able to replicate quite easily. |
Upgraded to version 4.1.0 and the issue still remains. It seems to only happen when all values are negative, and it is still random. iPhone 15 Pro Simulator |
Thank you for the suggestion. This actually helped! Starting from drawText, I was able to determine that the bug is actually caused by the following line of code inside of the drawValues(context: CGContext) method in the BarChartRenderer.swift class: `
` And when I comment that code out, it displays the values as expected: If someone could shed some light on this code, and tell us what its doing (and why it is causing this bug) that would be appreciated. Otherwise, its working fine without this code and hopefully it is fixed in the future. |
What did you do?
Create a Bar Chart view. Create a data set where all values are negative.
What did you expect to happen?
Expect the value labels to be rendered.
What happened instead?
Value labels do not always render. They may show up or disappear depending on the size of the chart view or containing view/window.
Easy to see when running in a Mac app and dragging the window size bigger or smaller.
Only seems to happen when all values are negative. With positive bar charts seems to be fine.
DGCharts Environment
DGCharts version/Branch/Commit Number: Current and any previous
Xcode version: 15.x and 14.x
Platform(s) running DGCharts: iOS 15+ and macOS 12+
The text was updated successfully, but these errors were encountered: