Comments (4)
You should use render_chart
helper method instead of calling to_js
directly, i.e.
render_chart(chart, 'div_id')
The render_chart
helper performs the proper html escaping before returning.
from google_visualr.
@jacobat is right. I didn't escape the labels:
@cols.each do |column|
js << "data_table.addColumn("
if column[:role].nil?
js << column.map{ |key, value| "'#{value}'" }.join(", ")
else
js << "{" + column.map{ |key, value| "#{key}: '#{value}'" }.join(", ") + "}"
end
js << ");"
end
from google_visualr.
Would it be possible to construct the JS strings with to_json
instead?
Say:
@cols.each do |column|
js << "data_table.addColumn("
js << column.to_json
js << ");"
end
from google_visualr.
Fixed. Thank you!
from google_visualr.
Related Issues (20)
- Support for PNG url? HOT 4
- Google Gantt charts stopped working HOT 2
- Rails 5 "undefined method 'helper_method' for ActionController::API::Class HOT 3
- Material design charts are broken for some chart types HOT 1
- Searching for Maintainer HOT 3
- http://googlevisualr.heroku.com/ is not working HOT 2
- How to use in IRuby notebook HOT 4
- How to draw a table HOT 7
- Use getImageURI ? HOT 1
- google_visualr conflict with ActiveAdmin/devise? HOT 2
- 3D column chart not working
- Scatter Chart
- Puma caught this error: undefined method `helper_method' for ActionController::API:Class (NoMethodError) HOT 3
- New Release HOT 4
- Unable to generate tooltips with html
- Possible reopen of sinatra #31 HOT 1
- Add support material design for Bar charts and Column Chart HOT 2
- Support to add packages HOT 6
- Add Line / Bar - Material Chart HOT 1
- Responsive Chart Width? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google_visualr.