News for hackers. Stuff that matters.
Re:Show HN: Create Chart Images from a URL by typpo on Wednesday March 06, 2019 @11:29AM (#19320118)
With the Google Image Charts API shutting down [1], I set out to build a replacement service that allows developers to create PNG images by encoding chart data and other options in a single URL.

Some might prefer an interactive Javascript charting library, but this is not possible in the case of email, SMS, Slack, and so on. This image generation solution is simpler and does not require external dependencies.

This project is open source and is pretty easy to run if you do not want to rely on the QuickChart.io web service: https://github.com/typpo/quickchart

I welcome your thoughts and feedback.

[1]: https://groups.google.com/forum/#!topic/google-chart-api/rZt...

Re:Show HN: Create Chart Images from a URL by fit2rule on Wednesday March 06, 2019 @02:26PM (#19321810)
Thanks for this - its an awesome service.

I was just wondering if you'd seen FF Chartwell? Its a font that allows the creation of these kinds of charts, albeit it uses typographic ligatures to produce the end results ..

https://www.fontshop.com/families/ff-chartwell

How to use it:

https://vimeo.com/41772735

I've found this to be a brilliant tool for the creation of neat charts in a jiffy - just like quickchart.io, albeit without requiring a network connection.

Anyway, thought you might be curious bout Chartwell, in case you hadn't seen it already .. maybe there is some synergy for a new version in the future?

Re:Show HN: Create Chart Images from a URL by M4v3R on Wednesday March 06, 2019 @12:53PM (#19320952)
That's a neat idea and nice of you to have made it open source, since the quickchart.io site seems to be down at the moment.
Re:Show HN: Create Chart Images from a URL by typpo on Wednesday March 06, 2019 @01:02PM (#19321018)
Indeed, I am upgrading it to a larger machine.
Re:Show HN: Create Chart Images from a URL by jkaptur on Wednesday March 06, 2019 @03:50PM (#19322623)
This is so cool. I just tested using it with the IMAGE formula in Google Sheets and it works really well:

  =IMAGE("https://quickchart.io/chart?c=" & ENCODEURL("{type:'radar',data:{labels:['January','February','March','April', 'May'], datasets:[{label:'Dogs',data:[50,60,70,180,190]},{label:'Cats',data:[100,200,300,400,500]}]}}"), 1)
Re:Show HN: Create Chart Images from a URL by whatl3y on Wednesday March 06, 2019 @03:33PM (#19322465)
Nice! I built the following a year or two ago and it's currently running on AWS Lambda. It uses Highcharts to generate charts.

https://api.restcharts.com/

https://github.com/whatl3y/restcharts

A competitor that appears to be profitable and doing well is https://charturl.com/.

Re:Show HN: Create Chart Images from a URL by jedberg on Wednesday March 06, 2019 @05:18PM (#19323480)
TIL that Google Charts is shutting down. My first thought after seeing this was "how is this different than Google Charts?". Then I got to the bottom about GC shutting down.

I didn't use GC very much, but when I needed a quick chart it was super handy. Thanks for making this!

Re:Show HN: Create Chart Images from a URL by Ayesh on Thursday March 07, 2019 @07:53AM (#19327597)
TIL too, but I'm honestly not surprised.
Re:Show HN: Create Chart Images from a URL by mherrmann on Wednesday March 06, 2019 @03:19PM (#19322363)
Looks great :-) You should charge for it. Maybe even in the interest of your users, to keep the service alive. You could leave it open source so people can self-host, or use your server for a fee for convenience.
Re:Show HN: Create Chart Images from a URL by masukomi on Wednesday March 06, 2019 @11:45PM (#19325566)
agreed. 100%
Re:Show HN: Create Chart Images from a URL by paulrosenzweig on Wednesday March 06, 2019 @08:00PM (#19324681)
Great app! Here's a similar tool that I've seen, but haven't used: http://chartd.co
Re:Show HN: Create Chart Images from a URL by seanlaff on Wednesday March 06, 2019 @05:59PM (#19323862)
I’d recommend taking a look at Vega https://vega.github.io/vega/ or its sibling Vega-lite. It exposes all of its configuration via declarative JSON. I could see it working well for a use case like this
Re:Show HN: Create Chart Images from a URL by arielm on Wednesday March 06, 2019 @02:48PM (#19322071)
Looks great. There have been a few projects like this that I’ve seen but yours has a good amount of flexibility.

Do you intend to monetize this somehow? I imagine that throwing a few million daily requests on something that renders images (fast) isn’t exactly free to host...

Re:Show HN: Create Chart Images from a URL by andrethegiant on Wednesday March 06, 2019 @05:06PM (#19323388)
Cool! You should multiply the width and height of each chart on your marketing site by `window.devicePixelRatio` so that the graphs look crisp on Retina/HiDPI displays.
Re:Show HN: Create Chart Images from a URL by nsedlet on Wednesday March 06, 2019 @06:39PM (#19324127)
It looks like the charts default to 500x300. It would be nice to be able to pass a parameter specifying the size of the image returned. Then I could set the width of the <img/> to be half of that to get it to show properly on retina at an arbitrary size
Re:Show HN: Create Chart Images from a URL by typpo on Thursday March 07, 2019 @09:18AM (#19328137)
The API does support "width" and "height" query parameters to set image size!
Re:Show HN: Create Chart Images from a URL by nsedlet on Thursday March 07, 2019 @10:59AM (#19329079)
Ah, I'm wrong, sorry.

I'd been inspecting the image elements to see why they were fuzzy on my retina screen, and didn't see those params - it's in the docs right there on the page though. In that case I'd just update the marketing site to fetch larger images so they look good on retina.

This is a fantastic project, by the way. The need for this comes up all the time for us (e.g. charts for emails).

Re:Show HN: Create Chart Images from a URL by chii on Wednesday March 06, 2019 @08:26PM (#19324807)
Or generate an svg version of the chart!
Re:Show HN: Create Chart Images from a URL by joering2 on Wednesday March 06, 2019 @01:08PM (#19321069)
Great stuff and free :) question - you don't need to urlencode the paramteres in the URL? how so? Further - isnt that limited to 1024 chars per URI specs ?
Re:Show HN: Create Chart Images from a URL by typpo on Wednesday March 06, 2019 @01:41PM (#19321376)
You probably should urlencode the parameters for longer URLs and chart definitions containing special characters. For simpler examples we can get away without URL encoding.

The server is configured to accept up to ~64kb URLs. Some browsers have built-in limitations that range from 5120 characters (IE 11) to 64k [1]. Of course, a URL that large becomes very unwieldy. Maybe I should add a way to save charts to a short url.

[1] https://stackoverflow.com/questions/417142/what-is-the-maxim...

Re:Show HN: Create Chart Images from a URL by koolba on Wednesday March 06, 2019 @02:15PM (#19321700)
Could also add gzip/deflate/base64 of the query parameter. For many JSON payloads the compression ratio can be 10:1. If it’s all happening client side then the processing cost is pushed to the browser so an added decompress wouldn’t change much.
Re:Show HN: Create Chart Images from a URL by aeorgnoieang on Wednesday March 06, 2019 @01:45PM (#19321416)
It seems like you would need to encode the parameter value; and in the same way as anything else.

There isn't a limit of URI length per the relevant 'specs'. There are generally limits imposed by _browsers_, and probably web servers too tho.

Re:Show HN: Create Chart Images from a URL by duncans on Wednesday March 06, 2019 @05:20PM (#19323498)
... and proxies
Re:Show HN: Create Chart Images from a URL by oftenwrong on Wednesday March 06, 2019 @11:42AM (#19320254)
Are the example charts supposed to have red backgrounds? It loads that way on my system in 3 different browsers.

edit: It is working fine now. No more red backgrounds.

Re:Show HN: Create Chart Images from a URL by typpo on Wednesday March 06, 2019 @12:39PM (#19320829)
Seems to be a strange issue with transparent images on certain devices. I've corrected this and also added an optional "bkg" param to set the background color.
Re:Show HN: Create Chart Images from a URL by fiatjaf on Wednesday March 06, 2019 @05:17PM (#19323472)
Reminds me of the late Chartspree[0].

[0]: http://web.archive.org/web/20170201170400/http://chartspree....

Re:Show HN: Create Chart Images from a URL by huntermeyer on Thursday March 07, 2019 @12:28AM (#19325751)
https://www.image-charts.com is a drop-in replacement for Google Image Charts.
Re:Show HN: Create Chart Images from a URL by EForEndeavour on Thursday March 07, 2019 @08:22AM (#19327780)
Well, except for the watermark on all free-tier images.
Re:Show HN: Create Chart Images from a URL by max23_ on Wednesday March 06, 2019 @09:52PM (#19325210)
I never thought of using any service to generate a chart and this looks like it may come in handy in the future for me.

Glad that it is open source so people can self host it.

Re:Show HN: Create Chart Images from a URL by ggm on Wednesday March 06, 2019 @03:14PM (#19322315)
google visualisation api remains. its in-browser .js, heavier weight, but it works. So this is a replacement for throwing data at a central chart render engine, not a replacement for all current google charting methods. (disclaimer: I've built sites which depend on the google chart & visualisation api)

This replaces the deprecated image chart methods.

Re:Show HN: Create Chart Images from a URL by FabioFleitas on Wednesday March 06, 2019 @04:22PM (#19322931)
How do you compare to ChartURL (https://charturl.com)?
Re:Show HN: Create Chart Images from a URL by typpo on Wednesday March 06, 2019 @04:38PM (#19323116)
It's free, open source, and no watermark - so QuickChart compares favorably in that regard!

In terms of functionality, ChartURL is also built on Chart.js, so charting capabilities should be roughly equivalent. They've added the nice feature of being able to save your charts to a short URL.

Re:Show HN: Create Chart Images from a URL by fiatjaf on Wednesday March 06, 2019 @05:18PM (#19323482)
You don't have to login.

Just added it to https://github.com/fiatjaf/awesome-loginless

Re:Show HN: Create Chart Images from a URL by 52-6F-62 on Wednesday March 06, 2019 @04:36PM (#19323088)
Looks to be completely free.
Re:Show HN: Create Chart Images from a URL by masha_sb on Thursday March 07, 2019 @12:55AM (#19325858)
Neat Stuff! What is the max data that I can send it?