Live data from Hacker News

Show HN: Create Javascript charts with one line of Ruby

ankane.github.io

31–40 of 64 posts

Re: Show HN: Create Javascript charts with one line of Ruby

#32
post #18

Earlier quoted context omitted.

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.

Well, well, mccolin replying to akane, long live Context Optional. And nice work akane.

Long live Context Optional, indeed!

Re: Show HN: Create Javascript charts with one line of Ruby

#33
post #9

Error Loading Chart: Please install Google Charts or Highcharts

Did you include Google Charts or Highcharts as described in the installation instructions?

This is the message I see on the linked page, where (I'm guessing) the demo is supposed to be.

Re: Show HN: Create Javascript charts with one line of Ruby

#35

Assuming the data for the graph shown is the dots, then the lines between them should be straight, not curved, because othrwise the graph is pretending to have higher accuracy than it actually has, which is a lie.

it's called interpolation.

Re: Show HN: Create Javascript charts with one line of Ruby

#36
post #6

The ruby wrapper lib around the JS is dead simple. Could be ported to any language with ease. Very nice work! https://github.com/ankane/chartkick/blob/master/lib/chartkic...

If anyone's looking for similar functionality for PHP (Database-level time-grouping, time-ranged drilldowns, charts), you can check out http://razorflow.com

(Disclosure: I am the developer of RazorFlow, and am only posting here because I feel it's relevant to this particular story)

Re: Show HN: Create Javascript charts with one line of Ruby

#37
post #28

Earlier quoted context omitted.

"Beautiful charts with 1 line of ruby" "This looks nice, but most of the hard work is done elsewhere." What were you expecting?

The title seems to lead on that it's possible to create beautiful charts with just one line of Ruby, when really it's 'Create beautiful charts with just one line of Ruby (if you use these libraries).' The original title is 'Create beautiful Javascript charts with one line of Ruby', which is more accurate.

Well, it's true: You can create charts with just one line of Ruby. The fact that it uses libraries to provide such a service is irrelevant to the assertion.

Re: Show HN: Create Javascript charts with one line of Ruby

#39

If 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.

Why should the controller be generating graphics? The UI can do that.

Depending upon the number of data points you are representing, images may take less bandwidth and transfer time than the data itself. For example suppose you have a chart showing network latency; if you sample once a minute and show a month's worth of data you could easily transfer around 500KB for the raw data (assuming 12 bytes of json per sample), while an image file would be 20KB. If you have a dashboard full of images like this, the time to download all that data could become pretty significant to the end-user.

Re: Show HN: Create Javascript charts with one line of Ruby

#40
post #28

Earlier quoted context omitted.

"Beautiful charts with 1 line of ruby" "This looks nice, but most of the hard work is done elsewhere." What were you expecting?

The title seems to lead on that it's possible to create beautiful charts with just one line of Ruby, when really it's 'Create beautiful charts with just one line of Ruby (if you use these libraries).' The original title is 'Create beautiful Javascript charts with one line of Ruby', which is more accurate.

Agh, pedantic semantics!
Post reply on HN