Browse Source

chore: add example for #1689 (#2082)

pull/2090/head
Yoshiya Hinosawa 8 years ago committed by GitHub
parent
commit
b468888e22
  1. 3
      htdocs/index.html
  2. 32
      htdocs/samples/different_category_datasets.html

3
htdocs/index.html

@ -119,6 +119,9 @@
<a href="./samples/custom_x_categorized.html"> <a href="./samples/custom_x_categorized.html">
Chart with category data on category axis Chart with category data on category axis
</a> </a>
<a href="./samples/different_category_datasets.html">
Chart with different category datasets
</a>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<h3>Additional Axis</h3> <h3>Additional Axis</h3>

32
htdocs/samples/different_category_datasets.html

@ -0,0 +1,32 @@
<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: {
xs: {
data1: "cat1",
data2: "cat2",
},
columns: [
["cat1", "a", "b", "c", "d"],
["data1", 30, 200, 100, 400],
["cat2", "b", "a", "c", "d", "e", "f"],
["data2", 400, 60, 200, 800, 10, 10]
]
},
axis: {
x: {
type: "category"
}
}
});
</script>
</body>
</html>
Loading…
Cancel
Save