|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link href="../css/c3.css" rel="stylesheet" type="text/css">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="chart1"></div>
|
|
|
|
<div id="chart2"></div>
|
|
|
|
<div id="chart3"></div>
|
|
|
|
|
|
|
|
<script src="https://d3js.org/d3.v5.min.js" charset="utf-8"></script>
|
|
|
|
<script src="../js/c3.js"></script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
var chart1 = c3.generate({
|
|
|
|
bindto: '#chart1',
|
|
|
|
data: {
|
|
|
|
columns: [
|
|
|
|
['data1', 300, 350, 300, 0, 0, 100],
|
|
|
|
['data2', 130, 0, 140, 200, 0, 50],
|
|
|
|
],
|
|
|
|
type: 'area',
|
|
|
|
groups: [['data1', 'data2']],
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var chart2 = c3.generate({
|
|
|
|
bindto: '#chart2',
|
|
|
|
data: {
|
|
|
|
columns: [
|
|
|
|
['data1', -300, -350, -300, 0, 0, -100],
|
|
|
|
['data2', -130, 0, -140, -200, 0, -50]
|
|
|
|
],
|
|
|
|
type: 'area',
|
|
|
|
groups: [['data1', 'data2']],
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var chart3 = c3.generate({
|
|
|
|
bindto: '#chart3',
|
|
|
|
data: {
|
|
|
|
columns: [
|
|
|
|
['data1', -300, 350, -300, 0, 0, 100],
|
|
|
|
['data2', -130, 0, 140, -200, 150, -50]
|
|
|
|
],
|
|
|
|
type: 'area',
|
|
|
|
groups: [['data1', 'data2']],
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|