UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

SOLVED: Minor issue with Charts

Forums > SwiftUI

Code is working, but need some halp with formating axis values. Specifically, how can I set the presicion on the y-axis? When the values become "too" small, the values are all rounded to 1.0E2.

Image posted to Imgur at https://imgur.com/N9qKzYi

2      

Hi, Try adding this to the chart

.chartYAxis {
            AxisMarks(
                format: Decimal.FormatStyle.number
            )
        }

2      

Thank you! Works better than before. Will playing around with it.

2      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.