I highly recommend it over writing JS for your highcharts, esp if you push a lot of data into the chart.
Show HN: Create Javascript charts with one line of Ruby
21–30 of 64 posts
Re: Show HN: Create Javascript charts with one line of Ruby
#22This looks nice, but most of the hard work is done elsewhere. https://github.com/ankane/groupdate (by the same author) makes it simple to output the right JSON grouped by date (awesome!) Highcharts/Google charts make it simple to turn json into JS graphs. This library provides glue so you don't have to read the highchart docs. Might save some people some time, I guess...
My favorite part about the library is you don't need to worry about getting the data in correct format. It just works with existing Rails methods, like ActiveRecord's count.
Also, Google Charts look a lot better with a little bit of custom styling.
Re: Show HN: Create Javascript charts with one line of Ruby
#23Nice, going to try this. I particularly like the groupdate concept, and might send you a pull request adding 2.X support, if that fits in line with the project goals. I should have rolled my own years ago rather than repeating the same code at 100 places.
Re: Show HN: Create Javascript charts with one line of Ruby
#24Re: Show HN: Create Javascript charts with one line of Ruby
#25amazing .
Re: Show HN: Create Javascript charts with one line of Ruby
#26This looks nice, but most of the hard work is done elsewhere. https://github.com/ankane/groupdate (by the same author) makes it simple to output the right JSON grouped by date (awesome!) Highcharts/Google charts make it simple to turn json into JS graphs. This library provides glue so you don't have to read the highchart docs. Might save some people some time, I guess...
"This looks nice, but most of the hard work is done elsewhere."
What were you expecting?
Re: Show HN: Create Javascript charts with one line of Ruby
#27I was pretty surprised when I got to the ChartsController and saw it returning JSON. Seems like the hard way to go about it. I just assumed it was generating SVGs.
Re: Show HN: Create Javascript charts with one line of Ruby
#28This looks nice, but most of the hard work is done elsewhere. https://github.com/ankane/groupdate (by the same author) makes it simple to output the right JSON grouped by date (awesome!) Highcharts/Google charts make it simple to turn json into JS graphs. This library provides glue so you don't have to read the highchart docs. Might save some people some time, I guess...
"Beautiful charts with 1 line of ruby" "This looks nice, but most of the hard work is done elsewhere." What were you expecting?
The original title is 'Create beautiful Javascript charts with one line of Ruby', which is more accurate.
Re: Show HN: Create Javascript charts with one line of Ruby
#29If you want to "AJAX" an image onto the page after the initial page load, why not just use an tag? You may be surprised to learn that it's even part of the HTML spec! I was pretty surprised when I got to the ChartsController and saw it returning JSON. Seems like the hard way to go about it. I just assumed it was generating SVGs.
Re: Show HN: Create Javascript charts with one line of Ruby
#30Earlier quoted context omitted.
Thanks! I started out heavy on the Ruby side but moved most logic to the JS to make AJAX charts dead simple to implement. (render :json => chart_data)
The ruby wrapping lib supports AJAX out of the box by passing a URL or route path to the helper and returning JSON from that endpoint.