Skip to content
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

How to align text to top #2

Open
arbyruns opened this issue Apr 7, 2022 · 2 comments
Open

How to align text to top #2

arbyruns opened this issue Apr 7, 2022 · 2 comments

Comments

@arbyruns
Copy link

arbyruns commented Apr 7, 2022

I'm trying to understand how to apply the Axis Text to appear at the top of where axisToolTip is being applied.

Code:

 .axisToolTip(isPresented: $tooltip, alignment: .bottomTrailing, constant: constant, foreground:  {
                                    Label("Contrary to popular belief, Lorem Ipsum is not simply random text.", systemImage: "heart")
                                        .padding()
                                        .frame(width: 200)
                                })

Result

image

Expected

image

@arbyruns
Copy link
Author

arbyruns commented Apr 7, 2022

I sort of figured it out, but I needed to have a constant similar to the below

@State private var constant: ATConstant = .init(axisMode: .top)

Is this the only way to specify the position in the case I have more than one Tooltip?

@Mcrich23
Copy link

@arbyruns, Just make different configs for different axis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants