Code Monkey home page Code Monkey logo

Comments (6)

cc-signet avatar cc-signet commented on July 30, 2024 2

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?

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:

`
Swift

                    guard viewPortHandler.isInBoundsY(rect.origin.y),
                        viewPortHandler.isInBoundsLeft(x)
                        else { continue }

`

image

And when I comment that code out, it displays the values as expected:

image

Before:
Before

After:
Fixed

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.

from charts.

liuxuan30 avatar liuxuan30 commented on July 30, 2024 1

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?

from charts.

ChrisColeTech avatar ChrisColeTech commented on July 30, 2024

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
iOS 14.5
XCode 12.5
Swift 4

from charts.

gabors avatar gabors commented on July 30, 2024

Please help us. Thanks @danielgindi

from charts.

gabors avatar gabors commented on July 30, 2024

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.
Mac Catalyst in my case. Labels disappear randomly depending on the chart view frame size.
It's really easy to see on Mac as you can freely resize the app window.

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.

from charts.

cc-signet avatar cc-signet commented on July 30, 2024

Same issue here.

It happens randomly. I've tried changing storyboard constraints, font sizes, leftAxis spaceTop/spaceBottom and nothing consistently works.

Charts 3.2.2

iPhone 11 Pro Simulator iOS 14.5 XCode 12.5 Swift 4

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.

Expected result:
Expected

Actual result:
Actual

iPhone 15 Pro Simulator
iOS 17.4
XCode 15.3
Swift 4

from charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.