Wednesday, 27 May 2020

Bring Data to HTML using D3 JS

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>HTML Data</title>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.js'></script>
</head>
<body>
  <script>
  function GetData() {
 
fetch('https://jsonplaceholder.typicode.com/todos')
  .then(response => response.json())
  .then(json=> d3.select("div")
.selectAll("p")
.data(json)
.enter()
.append("p")
.text(d => d.title));
  }
  GetData();
  </script>
 
  <h1>Hello World</h1>
  <div></div>
</body>
</html>

No comments:

SQL: Generate a range of numbers

SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n FROM       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),      (VALU...