Stacked Bar Chart with a Line Chart
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>Normalized Stacked Bar Chart with Line</title>
<!-- JavaScript Libraries //-->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.7.1/d3-tip.min.js"></script>
<!-- CSS Style //-->
<link href="style.css" rel="stylesheet" type="text/css">
<link href="d3-tip.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="main.js"></script>
</head>
<body>
<div id="chart"></div>
</body>
<script>
var inputData = [
{
"1483209000000":50,
"1483223400000":60,
"1483237800000":70,
"1483252200000":80,
"1483266600000":90,
"1483281000000":100,
"1483338600000":110,
"1483353000000":120,
"1483367400000":130,
"1483381800000":140,
"1483396200000":150,
"1483410600000":160,
"1483425000000":170,
"1483439400000":180,
"1483468200000":190,
"CategoryNames":"Base"
},
{
"1483209000000":20,
"1483223400000":30,
"1483237800000":40,
"1483252200000":50,
"1483266600000":60,
"1483281000000":70,
"1483338600000":80,
"1483353000000":90,
"1483367400000":100,
"1483381800000":110,
"1483396200000":120,
"1483410600000":130,
"1483425000000":140,
"1483439400000":150,
"1483468200000":160,
"CategoryNames":"Category 1"
},
{
"1483209000000":30,
"1483223400000":30,
"1483237800000":30,
"1483252200000":30,
"1483266600000":30,
"1483281000000":30,
"1483338600000":30,
"1483353000000":30,
"1483367400000":30,
"1483381800000":30,
"1483396200000":30,
"1483410600000":30,
"1483425000000":30,
"1483439400000":30,
"1483468200000":30,
"CategoryNames":"Category 2"
}
];
renderNormalizedStackBarChart(inputData,"#chart");
</script>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://code.jquery.com/jquery-3.1.1.min.js
https://d3js.org/d3.v3.min.js
https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.7.1/d3-tip.min.js