Browse Source

Add sample for combination chart

pull/3/head
Masayuki Tanaka 11 years ago
parent
commit
ae03ed309b
  1. 7
      htdocs/index.html
  2. 39
      htdocs/samples/chart_combination.html

7
htdocs/index.html

@ -92,6 +92,13 @@
<p><a class="btn btn-default" href="/samples/chart_spline.html" role="button">View details &raquo;</a></p>
</div>
</div>
<div class="row">
<div class="col-md-4">
<h3>Combination Chart</h3>
<p>Display as Bar Chart</p>
<p><a class="btn btn-default" href="/samples/chart_combination.html" role="button">View details &raquo;</a></p>
</div>
</div>
</div>
</div>
</div>

39
htdocs/samples/chart_combination.html

@ -0,0 +1,39 @@
<html>
<head>
<link href="/css/c3.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="chart"></div>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="/js/c3.min.js"></script>
<script>
var chart = c3.generate({
data: {
columns: [
['data1', 30, 20, 50, 40, 60, 50],
['data2', 200, 130, 90, 240, 130, 220],
['data3', 300, 200, 160, 400, 250, 250],
['data4', 200, 130, 90, 240, 130, 220],
['data5', 130, 120, 150, 140, 160, 150]
],
types: {
data1: 'bar',
data2: 'bar',
data3: 'spline',
data4: 'line',
data5: 'bar',
},
groups: [
['data1','data2']
]
},
axis: {
x: {
type: 'categorized'
}
}
});
</script>
</body>
</html>
Loading…
Cancel
Save