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.
77 lines
1.6 KiB
77 lines
1.6 KiB
10 years ago
|
<html>
|
||
|
<head>
|
||
|
<link rel="stylesheet" type="text/css" href="/css/c3.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="chart1"></div>
|
||
|
<div id="chart2"></div>
|
||
|
<div id="chart3"></div>
|
||
|
|
||
7 years ago
|
<script src="http://d3js.org/d3.v4.min.js" charset="utf-8"></script>
|
||
10 years ago
|
<script src="/js/c3.js"></script>
|
||
|
<script>
|
||
|
|
||
|
var chart1 = c3.generate({
|
||
|
bindto: '#chart1',
|
||
|
data: {
|
||
|
columns: [
|
||
|
['data1', 100, 200, 50, 300, 400, 290],
|
||
|
['data2', 10, 20, 50, 30, 10, 100],
|
||
|
],
|
||
|
},
|
||
|
axis: {
|
||
|
x: {
|
||
7 years ago
|
selection: [2, 4.5]
|
||
10 years ago
|
}
|
||
|
},
|
||
|
subchart: {
|
||
|
show: true
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var chart2 = c3.generate({
|
||
|
bindto: '#chart2',
|
||
|
data: {
|
||
|
x: 'x',
|
||
|
columns: [
|
||
|
['x', '2014-01-01', '2014-02-01', '2014-03-01', '2014-04-01', '2014-05-01', '2014-06-01'],
|
||
|
['data1', 100, 200, 50, 300, 400, 290],
|
||
|
['data2', 10, 20, 50, 30, 10, 100],
|
||
|
],
|
||
|
},
|
||
|
axis: {
|
||
|
x: {
|
||
|
type: 'timeseries',
|
||
7 years ago
|
selection: ['2014-03-01', '2014-04-20']
|
||
10 years ago
|
}
|
||
|
},
|
||
|
subchart: {
|
||
|
show: true
|
||
|
}
|
||
|
});
|
||
|
|
||
|
var chart3 = c3.generate({
|
||
|
bindto: '#chart3',
|
||
|
data: {
|
||
|
columns: [
|
||
|
['data1', 100, 200, 50, 300, 400, 290],
|
||
|
['data2', 10, 20, 50, 30, 10, 100],
|
||
|
],
|
||
|
},
|
||
|
axis: {
|
||
|
x: {
|
||
7 years ago
|
selection: [1, 4.2]
|
||
10 years ago
|
}
|
||
|
},
|
||
|
zoom: {
|
||
|
enabled: true
|
||
|
},
|
||
|
subchart: {
|
||
|
show: true
|
||
|
}
|
||
|
});
|
||
|
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|