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

Adds ability to generate Material charts when applicable #88

Closed
wants to merge 5 commits into from

Conversation

egoens
Copy link

@egoens egoens commented Apr 21, 2015

By passing in material: true to the render_chart helper, this will render the "Material" style google graphs.

https://google-developers.appspot.com/chart/interactive/docs/gallery/scatterchart#Material

Example usage:
<%= render_chart(@chart, 'scatterchart_material', {material: true}) %>

Not all graphs are Material enabled so it will be up to the developer to determine if this option can be used.

end

def load_material_js(element_id)
"\n google.load('visualization','1.1', {packages: ['#{material_package_name.downcase}'], callback: #{chart_function_name(element_id)}});"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [144/80]

@listeners.each do |listener|
js << "\n google.visualization.events.addListener(chart, '#{listener[:event]}', #{listener[:callback]});"
end
js << "\n chart.draw(data_table, google.charts.#{material_package_name}.convertOptions(#{js_parameters(@options)}));"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [126/80]

@winston winston mentioned this pull request Aug 26, 2015
@winston
Copy link
Owner

winston commented Aug 27, 2015

@egoens Thanks for this PR, however, it only seem to work for bar charts. I have done #95 though and it would be able to support the other material charts too. Please do take a look.

Closing this. 🙇

@winston winston closed this Aug 27, 2015
@egoens
Copy link
Author

egoens commented Aug 27, 2015

👍 Awesome. Thanks for the integration @winston

@winston
Copy link
Owner

winston commented Aug 28, 2015

Welcome! Thank you!

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

Successfully merging this pull request may close these issues.

3 participants