Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2015
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can't get the d3.js external resources to work

    I tried copying the HTML, Javascript, & CSS code from this JSFiddle:

    simple D3 line chart - JSFiddle

    into this one

    https://jsfiddle.net/madamefeemy/ohdgpq6q/2/

    The original Jsfiddle didn't show any external resources, so I included the line: <script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>

    but it still isn't working.

    If anyone could offer insight as to how I can get D3.js to work, I would appreciate it. Thanks!

  2. #2
    Regular Coder
    Join Date
    Feb 2016
    Posts
    906
    Thanks
    0
    Thanked 187 Times in 185 Posts
    The original Jsfiddle didn't show any external resources
    No, it does: D3 is included in the settings of the Javascript section (wheel icon top right).

  3. #3
    New Coder
    Join Date
    May 2015
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, thank you for your help. It works when I use the wheel icon to select d3.js, but why doesn't the code run when I just included the following at the top of my HTML script:

    <script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>

    Doesn't that serve the same purpose?

  4. #4
    Regular Coder
    Join Date
    Feb 2016
    Posts
    906
    Thanks
    0
    Thanked 187 Times in 185 Posts
    Obviously there is a mismatch in the version of d3js: When I include Version 3 the fiddle works:
    https://jsfiddle.net/Sempervivum/ohdgpq6q/4/

  5. #5
    New Coder
    Join Date
    May 2015
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hm, interesting. Thanks, Sempervivum.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •