|
|
@ -3,14 +3,18 @@ |
|
|
|
<link href="/css/c3.css" rel="stylesheet" type="text/css"> |
|
|
|
<link href="/css/c3.css" rel="stylesheet" type="text/css"> |
|
|
|
</head> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
<body> |
|
|
|
<div id="chart"></div> |
|
|
|
<div id="chart1"></div> |
|
|
|
|
|
|
|
<div id="chart2"></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> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
var chart = c3.generate({ |
|
|
|
var chart1 = c3.generate({ |
|
|
|
|
|
|
|
bindto: '#chart1', |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
|
|
|
|
x: 'x', |
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
|
|
|
|
|
['x', '1e-3', '1e-2', '1'], |
|
|
|
['data1', 30, 200, 100, 400, 150, 250, 50, 100, 250] |
|
|
|
['data1', 30, 200, 100, 400, 150, 250, 50, 100, 250] |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
@ -21,9 +25,28 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var chart2 = c3.generate({ |
|
|
|
|
|
|
|
bindto: '#chart2', |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
['data1', 30, 200, 100, 400, 150, 250, 50, 100, 250] |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
axis: { |
|
|
|
|
|
|
|
x: { |
|
|
|
|
|
|
|
categories: ['1e-3', '1e-2', '1e-1', '0', 'hoge'], |
|
|
|
|
|
|
|
type: 'categorized' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
|
|
chart1.load({columns:[['data2', 30, 20, 50, 40, 60, 50, 100, 200, 300,100]]}); |
|
|
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function () { |
|
|
|
chart.load({columns:[['data2', 30, 20, 50, 40, 60, 50, 100, 200, 300,100]]}); |
|
|
|
chart2.load({columns:[['data2', 30, 20, 50, 40, 60, 50, 100, 200, 300,100]]}); |
|
|
|
}, 500); |
|
|
|
}, 2000); |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</body> |
|
|
|