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

Allow charts to support responsive build #9

Closed
J5Dev opened this issue Nov 4, 2014 · 4 comments
Closed

Allow charts to support responsive build #9

J5Dev opened this issue Nov 4, 2014 · 4 comments
Assignees

Comments

@J5Dev
Copy link

J5Dev commented Nov 4, 2014

I would like to be able to provide make the charts produced be scalable for use within responsive pages.

I am aware that this can be done by simply redrawing the charts upon window resize. However I think that the flexibility to do this with a snap delay to prevent idiotic amounts of redraws.

I am having issues with this due to having numerous charts on the page, all within the simple named function of drawChart(), making it unable to call them individually.

Is it possible to have the function name revised allowing for each chart to be interacted with outside the code control of the builder?

@kevinkhill
Copy link
Owner

This was a problem I thought might occur, so for v2, I created a js class that can interact with the charts outside of the drawChart() function. Its syntax is

lava.get('chartName')

which returns the actual google chart object, giving access to any of the functions at the javascript level that the google chart api allows.

@J5Dev
Copy link
Author

J5Dev commented Nov 12, 2014

A very nice solution, and will help with a few other issues I have run into such as being able to utilise the charts dynamically using ajax etc, again thank you, I should be able to give it a running test in the next few weeks.

@kevinkhill
Copy link
Owner

If you want to give it a test drive, the V2 API is compete, I am just waiting to publish until I finish the new site and docs. You can clone the 2.0 branch and dig around if you want, or if you have jekyll installed, clone the ghp2.0 branch and check out the site/docs. Any feedback would be greatly appreciated :)

@kevinkhill
Copy link
Owner

No need to call the above mentioned js method. It is used internally by the lava js core to register each chart with the window.resize function (which is also debounced)

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

No branches or pull requests

2 participants