Live data from Hacker News

Show HN: Easy SVG charts for your static site, no JavaScript

chartspree.com

41–43 of 43 posts

Re: Show HN: Easy SVG charts for your static site, no JavaScript

#41
The first image on the page shows a series of data 1,1,2,3,5

but the chart shows the last bar going to six.

The URL makes it apparent that it's just a typo, but it's the literally the first thing on the page :)

http://api.chartspree.com/bar.svg?Foo=1,1,2,3,6&_height=250p...

Re: Show HN: Easy SVG charts for your static site, no JavaScript

#42
post #8
post #6

Earlier quoted context omitted.

But that way you are throwing away the only benefit - that it works without javascript. It's really expensive to draw graphs and it's better to be offloaded to clients. I can't think of many reasons for building them serverwise.. except for when you don't have access to javascript or you are limited by the power as well.

I disagree, as even if you did use Javascript the service is still far more accessible to a novice developer than something like the d3.js library (which I love, but has a rather steep learning curve). Additionally, you would be surprised at how much could be accomplished in that department with just CSS.

That's a limitation of d3.js, not JavaScript. gRaphaël is pretty easy to use: http://g.raphaeljs.com/

Re: Show HN: Easy SVG charts for your static site, no JavaScript

#43
post #34
post #32

Earlier quoted context omitted.

Curious about that too. If I load an svg in the address bar with embedded script I can show alert(), but linked into html using tag, alert does not run. Sandboxed? Otherwise I could execute JS just by loading in using svg via .

Looks like it's not sandboxed at all? > Any functions defined within any script element have a global scope across the entire current document. [0] https://developer.mozilla.org/en-US/docs/Web/SVG/Element/scr...

As images / targets, SVG documents have their own global scope, much like a page in an iframe.
Post reply on HN