D3 Bar Graph example not working locally

前端 未结 3 1062
灰色年华
灰色年华 2020-11-27 21:09

I am very new to D3, and wanted to see how an example would work locally. I copied and pasted the bar graph code to a local file called index.html, and also copied over the

3条回答
  •  甜味超标
    2020-11-27 21:35

    As an alternative, and I was myself suggested by Lars Kotthoff when trying to work with .tsv/.csv files, you can work directly for this purpose on:

    http://plnkr.co/

    This enables you to work with all the .json / .tsv / .csv files you like, and share them with people for collaboration. You can do this anonymously or not, what matters is that you don't lose the then-generated HTTP address of your plunker.

    One thing to pay attention to: you cannot upload directly the files in the way you would do on an FTP server, but you should instead:

    1. Click on "new file"
    2. Type the name of your .csv / .tsv / .json file as referred to in your code (including the extension)
    3. Copy and paste the code contained in this file as is.
    4. Don't forget to update the names of your .css / .js if required so the match with that of your index.html

提交回复
热议问题