Simplest way to generate many chart images from a csv?
August 24, 2013 3:02 AM   Subscribe

I have been looking at Chartbuilder and d3.js as a means to generate chart images for clients. We make them a video and instream advertise it. We report monthly impressions and views of the video. What would be the best way to present this data?

I like how simple to use Chartbuilder is but I would like to skip having to paste in the data. I am thinking that I may need to create a database so that I may most easily export a particular client's data than a cobbled together spreadsheet. Would either Chartbuilder, d3.js or another tool be best for generating a decent looking line graph illustrating a video's monthly impressions and views? Right now the reports my organization sends out are just spreadsheets. We're moving toward sending out a generated chart image but I'd like to try and make this process as automated as possible. I would like to avoid working with databases but i'll take any recommendations. I'm also somewhat clueless as the best ways to present this data. I like the look of either two line graphs or one a line graph and the other a column. Any suggestion is welcome.
posted by andendau to Computers & Internet (6 answers total) 7 users marked this as a favorite
The R package ggplot might be worth a look. It offers a range of different plot types that might be appropriate for your data. It does have a bit of a steep learning curve however.
posted by tnai at 5:29 AM on August 24, 2013

Your question isn't entirely clear on how you're publishing the graph. You want to make a static graph that you embed in a video? Is there any interactive component? Is it important to embed the graph in a web page, email, or print?

The way I'd do this is write some custom D3.js code that imports my data from a CSV file. As D3 projects go that's pretty simple, but D3 is pretty low level and requires a fair amount of programming just to make a simple chart. There are a bunch of libraries built on top of D3 that package up specific types of charts that are easier to use, but I'm not competent to review them.

One nice thing about D3 is you can export the graph as SVG, then load it into Illustrator to make it look prettier. That's not useful for Web presentation but if you have a visual designer who wants to add some sparkle to a graph, it's a good workflow.

Nathan Yau's new book Data Points is a good introduction on how to think about questions like "two line graphs or one a column?". It won't answer your specific question, but it's a good resource for learning more about making good choices in visualizations.
posted by Nelson at 8:50 AM on August 24, 2013

Response by poster: To be clear I would like a static image such as what chart builder can export. Only without having to export an image one by one. It seems like I may have to stick with it because the graphical appeal of it seems pretty good to me.
posted by andendau at 10:01 AM on August 24, 2013

Best answer: How comfortable are you with JavaScript? d3 is incredibly powerful and will ultimately give you the most control and flexibility over your visualizations, but it will require some up-front investment from you. Perhaps you can get some of your sample data into a javascript array, then use it to go through Mike Bostock's introductory bar chart tutorial to get a sense of whether or not this is something you want to take on.

Re: avoiding the database: You can use something like sheetsee.js, which will provide you with the boilerplate code for using a Google Spreadsheet as the data source for a d3 graph.

I recently wrote a graph app that also uses a Google Spreadsheet as a data source. It's quite a bit uglier, but the source could help as a reference if your app isn't a good fit for sheetsee, and you need to write it from scratch.

As for getting the screenshot, PhantomJS is a headless browser kit that can help you with that.
posted by ignignokt at 12:39 PM on August 24, 2013

Response by poster: Thank you Nelson I think I may have to check out that book. I would like to know the answer to that question you provided. I like the graphic that chartbuilder generates but may not have the type of chart I need. The values I am sending to clients aren't very impressive and the chart has to convey they're getting some kind of result for their money.

Thanks ignignokt those are some good ideas. I'm not very comfortable with javascript but I might be able to puzzle something out. PhatomJS seems really easy to use.
posted by andendau at 9:29 PM on August 24, 2013

sounds like you could use Tableau. They do csv as well as db tables. A public free version is available online.
posted by ptm at 11:49 PM on August 24, 2013

« Older Stopping Staph Infections   |   Dog + Delivery Driver + Paws through window pane ≠... Newer »
This thread is closed to new comments.