Tuesday, November 2, 2021

d3.extent function in d3js

 <!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>d3.extent function</title>

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

    <link href="https://www.w3schools.com/w3css/4/w3.css" rel="stylesheet"

          type="text/css"/>

  </head>

<body>

    <script>

        var array1 = [10, 20, 30, 40];

        var array2 = [1, 2];


        A = d3.extent(array1);


        B = d3.extent(array2);

        document.write(A + "<br>");

        document.write(B + "<br>");

    </script>

</body>

</html>


Output:-

10,40
1,2

No comments:

Post a Comment