|
|
@ -3,9 +3,16 @@ |
|
|
|
<link href="/css/c3.css" rel="stylesheet" type="text/css"> |
|
|
|
<link href="/css/c3.css" rel="stylesheet" type="text/css"> |
|
|
|
</head> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
<body> |
|
|
|
|
|
|
|
<h3>Zerobased</h3> |
|
|
|
<div id="chart1"></div> |
|
|
|
<div id="chart1"></div> |
|
|
|
|
|
|
|
<h3>Not zerobased because of axis.y.min</h3> |
|
|
|
<div id="chart2"></div> |
|
|
|
<div id="chart2"></div> |
|
|
|
|
|
|
|
<h3>Zerobased</h3> |
|
|
|
<div id="chart3"></div> |
|
|
|
<div id="chart3"></div> |
|
|
|
|
|
|
|
<h3>Not zerobased because of axis.y.min</h3> |
|
|
|
|
|
|
|
<div id="chart4"></div> |
|
|
|
|
|
|
|
<h3>+/- vaulues</h3> |
|
|
|
|
|
|
|
<div id="chart5"></div> |
|
|
|
|
|
|
|
|
|
|
|
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> |
|
|
|
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> |
|
|
|
<script src="/js/c3.js"></script> |
|
|
|
<script src="/js/c3.js"></script> |
|
|
@ -26,15 +33,47 @@ |
|
|
|
bindto: '#chart2', |
|
|
|
bindto: '#chart2', |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
|
['data1', -300, -350, -300, 0, 0, 0], |
|
|
|
['data1', 300, 350, 300, 0, 0, 0], |
|
|
|
['data2', -130, -100, -140, -200, -150, -50] |
|
|
|
['data2', 130, 100, 140, 200, 150, 50] |
|
|
|
], |
|
|
|
], |
|
|
|
type: 'area' |
|
|
|
type: 'area' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
axis: { |
|
|
|
|
|
|
|
y: { |
|
|
|
|
|
|
|
min: 100, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var chart3 = c3.generate({ |
|
|
|
var chart3 = c3.generate({ |
|
|
|
bindto: '#chart3', |
|
|
|
bindto: '#chart3', |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
['data1', -300, -350, -300, 0, 0, 0], |
|
|
|
|
|
|
|
['data2', -130, -100, -140, -200, -150, -50] |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
type: 'area' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var chart4 = c3.generate({ |
|
|
|
|
|
|
|
bindto: '#chart4', |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
['data1', -300, -350, -300, 0, 0, 0], |
|
|
|
|
|
|
|
['data2', -130, -100, -140, -200, -150, -50] |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
type: 'area' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
axis: { |
|
|
|
|
|
|
|
y: { |
|
|
|
|
|
|
|
max: -100, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var chart5 = c3.generate({ |
|
|
|
|
|
|
|
bindto: '#chart5', |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
|
['data1', -300, 350, -300, 0, 0, 0], |
|
|
|
['data1', -300, 350, -300, 0, 0, 0], |
|
|
|