Search code examples
ruby-on-railsexcelaxlsx

Rails Create US State Graph


I have a client that recently decided to add in-site surveys as part of an effort to better understand their user base. They are requesting an export of the survey data, which using Axlsx hasn't been to hard.

However, they've also requested a US Map Graph that displays which users live in which states - kind of like this one. We store the GeoIP of each user's City/State/ZIP, etc. so the data is there, but I'm not sure how I'd go about generating such a graph as part of the Excel output.

Any ideas about this being feasible to spit out in an Excel export? I haven't been able to find much information about creating them in Rails.

EDIT I just want to point out that the actual Excel export works great. What I'm struggling with is getting a graph to come out in a similar format as the above link. I'm already using the axlsx gem to export the data into Excel/creating various graphs. I haven't been able to figure out how to create a US State's graph with it though


Solution

  • You might want to take a look to the gem axlsx, which is a spreadsheet generator for Ruby. They have a fair amount of examples.

    Hope it helps.