0

I need to extract the data from an excel sheet into csv or json format and then display the content in the form of charts(bar, pie and line) using javascript. I have been working on it since 2 days and not able to find any good source. Any help regarding this would be appreciated. Thank you.

1
  • 1
    This is covered in a lot of tutorials such as Christophe Viau and I assume that you know how to get a spreadheet to csv. The other issue you could have is cross site scripting, in which case you'll need to use a local web server. Commented Oct 20, 2013 at 7:32

1 Answer 1

1

You can also pull data from a google spreadsheet as CSV data like this:

var spreadsheet = "https://docs.google.com/spreadsheet/pub?key=youruniquekeyhere&single=true&gid=2&output=csv"

d3.csv(spreadsheet, function (error, data) {
  // use your data here
});

Notice the output=csv at the end of that URL.

gid=0 is worksheet 1, gid=1 is worksheet 2 and so on. You must publish your worksheet to the web first to make it available.

In addition to Christophe Viau's tutorials, here are more resources:

https://github.com/mbostock/d3/wiki/Gallery#basic-charts

http://www.d3noob.org

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.