This is an example of the d3Kit factory, which help you create a reusable chart.
Try it by
Modified http://d3js.org/d3.v3.min.js to a secure url
Updated missing url https://rawgit.com/kristw/75b61f9beeab9b530612/raw/389e984e4041117a9185cf6edad9f6b85a38097a/d3kit.min.js to https://cdn.jsdelivr.net/gh/kristw/75b61f9beeab9b530612/raw/389e984e4041117a9185cf6edad9f6b85a38097a/d3kit.min.js
https://d3js.org/d3.v3.min.js
https://rawgit.com/kristw/75b61f9beeab9b530612/raw/389e984e4041117a9185cf6edad9f6b85a38097a/d3kit.min.js