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 get current chart direction #341

Closed
kosirm opened this issue Dec 22, 2023 · 2 comments
Closed

How to get current chart direction #341

kosirm opened this issue Dec 22, 2023 · 2 comments

Comments

@kosirm
Copy link

kosirm commented Dec 22, 2023

Hi, I just discovered this library and I'm amazed with quality and usefulness of this library!
It is the best Christmas present for me this year :) Thank you so much for sharing this code!

I would like to make a few visual changes regarding the direction of the chart.
I found this nice function which rotates the chart:
onclick='chart.layout(["right","bottom","left","top"][index++%4]).render().fit()
but I don't know how can I get direction programatically...
If I try to see direction with
console.log("Direction:"+JSON.stringify(chart.layout(["top"])))
I expected true/false, but I get empty object:
Direction:{}

Thanks for any hint.

Merry Christmas and Happy New Year 2024!

@kosirm kosirm changed the title Get current chart direction How to get current chart direction Dec 22, 2023
@bumbeishvili
Copy link
Owner

bumbeishvili commented Dec 23, 2023

Hi, I'd suggest taking a look at installing section to understand how the library works and what/how you can customize/get/modify

https://github.com/bumbeishvili/org-chart?tab=readme-ov-file#installing

In your case,

chart.layout('top') // this sets the layout

chart.layout() // this gets the current layout

@kosirm
Copy link
Author

kosirm commented Dec 23, 2023

Perfect, thank you!

@kosirm kosirm closed this as completed Dec 24, 2023
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