0

I have a JSON data that is found on my URL: JSON

and i'm trying to use it using d3.json() for my charts but it won't return anything. below is my code:

var defaultHighAvailStaticUrl = "/highAvailabilities/" + defaultDate;
console.log(defaultHighAvailStaticUrl);

d3.json(defaultHighAvailStaticUrl, function(error, data) {
  if (error) throw error;
  console.log(data);

})

I don't know what is wrong. Also is it more easier if I use ajax instead? Since it's a lot more clearer to use i think but i don't know how to call the data in the d3.js chart functions especially on the .data() of d3. Do i need to use the $.each or should i just shoot on the d3.js codes?

Ajax code i'm planning to use:

$(document).ready(() => {
    $.ajax({
        url: (defaultHighAvailStaticUrl ),
        method: "GET",
        dataType: "json",
        success: (data) => {
            $.each(data, (key, val) => {

            });
        }
    })
});

console result: console_result

2
  • can you put the screenshot for browser console from output page ? Commented Apr 21, 2020 at 9:59
  • @altocumulus version 5.15.0 Commented Apr 21, 2020 at 12:09

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.