Faroe Islands Pyramid (example)

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="http://json-stat.org/lib/json-stat.js"></script>
    <link rel="stylesheet" href="http://idescat.github.io/visual/visual.css" />
    <script src="http://idescat.github.io/visual/lazyvisualsetup.js"></script>
  </head>

  <body>
    <div id="visual" class="visual"></div>

    <script>
    url="http://statbank.hagstova.fo/sq/3259d92b-492b-4d67-9f10-3a9c46de3fe4";

    function main(obj){
      ds=JSONstat(obj).Dataset(0);
      t=ds.Dimension("year").length-1;
      year=ds.Dimension("year").id[t];

      //Pyramid
      visual({
        lang: "en",
        type: "pyram",

        title: ds.label,
        footer: ds.source,

        time: ds.Dimension("year").Category(t).label,
        by: ds.Dimension("age", false),
        data: [
          {
            label: ds.Dimension("sex").Category("M").label,
            val: ds.Data({"sex": "M", "year": year}, false)
          },
          {
            label: ds.Dimension("sex").Category("K").label,
            val: ds.Data({"sex": "K", "year": year}, false)
          }
        ]
      });
    }

    GET(url, main);

    function GET(url, main){
      fetch( url )
        .then(function(resp) {
          resp.json().then(main);
        })
      ;
    }
    </script>
  </body>
</html>