mirror of https://github.com/masayuki0812/c3.git
Quite good looking graph derived from d3.js
http://c3js.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
11 years ago
|
<html>
|
||
|
<head>
|
||
|
<link rel="stylesheet" type="text/css" href="/css/c3.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="chart"></div>
|
||
|
|
||
|
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
|
||
|
<script src="/js/c3.js"></script>
|
||
|
<script>
|
||
|
var chart = c3.generate({
|
||
|
bindto: '#chart',
|
||
|
data: {
|
||
|
columns: [
|
||
|
['sample', 30, 200, 100, 400, 150, 250]
|
||
|
]
|
||
|
},
|
||
|
axis: {
|
||
|
// rotated: true,
|
||
|
},
|
||
|
grid: {
|
||
|
y: {
|
||
11 years ago
|
// lines: [{value: 30, text:'Label 30'}, {value: 250, text: 'Label 250'}]
|
||
11 years ago
|
}
|
||
|
}
|
||
|
});
|
||
11 years ago
|
|
||
|
setTimeout(function () {
|
||
11 years ago
|
chart.ygrids([{value: 130, text:'Label 130'}, {value: 50, text: 'Label 50'}]);
|
||
11 years ago
|
}, 1000);
|
||
|
|
||
|
setTimeout(function () {
|
||
11 years ago
|
chart.ygrids([{value: 130, text:'Label 130', class: 'hoge'}]);
|
||
11 years ago
|
}, 2000);
|
||
|
|
||
|
setTimeout(function () {
|
||
11 years ago
|
chart.ygrids.add([{value: 230, text:'Label 230', class: 'hoge'}]);
|
||
11 years ago
|
}, 3000);
|
||
|
|
||
|
setTimeout(function () {
|
||
|
chart.ygrids.remove({value: 230});
|
||
|
}, 4000);
|
||
|
|
||
|
setTimeout(function () {
|
||
|
chart.ygrids.remove({class: 'hoge'});
|
||
|
}, 5000);
|
||
|
|
||
11 years ago
|
</script>
|
||
|
</body>
|
||
|
</html>
|