| 1 |
<html> |
| 2 |
<head> |
| 3 |
<link href="/css/c3.css" rel="stylesheet" type="text/css"> |
| 4 |
</head> |
| 5 |
<body> |
| 6 |
<div id="chart"></div> |
| 7 |
|
| 8 |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> |
| 9 |
<script src="/js/c3.js"></script> |
| 10 |
<script> |
| 11 |
var chart = c3.generate({ |
| 12 |
data: { |
| 13 |
columns: [ |
| 14 |
['data1', 30, 200, 100, 400, 150, 250, 100, 600], |
| 15 |
['data2', 50, 20, 10, 40, 15, 25], |
| 16 |
] |
| 17 |
}, |
| 18 |
axis: { |
| 19 |
// rotated: true, |
| 20 |
x: { |
| 21 |
tick: { |
| 22 |
format: function () { return "hogehogehogehogehoge"; }, |
| 23 |
rotate: 30, |
| 24 |
}, |
| 25 |
label: { |
| 26 |
text: 'Hogehoge', |
| 27 |
position: 'outer-middle' |
| 28 |
}, |
| 29 |
height: 90, |
| 30 |
}, |
| 31 |
y: { |
| 32 |
label: { |
| 33 |
text: 'Y Label', |
| 34 |
position: 'outer-center' |
| 35 |
} |
| 36 |
} |
| 37 |
}, |
| 38 |
subchart: { |
| 39 |
show: true |
| 40 |
} |
| 41 |
}); |
| 42 |
|
| 43 |
setTimeout(function () { |
| 44 |
chart.load({ |
| 45 |
columns: [ |
| 46 |
// ['data1', 30, 200, 100, 400, 150, 250, 100, 400], |
| 47 |
['data1', 1030, 2000, 1000, 1400, 1500, 1250, 1100, 140000], |
| 48 |
] |
| 49 |
}) |
| 50 |
}, 1000); |
| 51 |
|
| 52 |
|
| 53 |
</script> |
| 54 |
</body> |
| 55 |
</html> |