Browse Source

Update sample for stacked bar chart - #30

pull/34/merge
Masayuki Tanaka 11 years ago
parent
commit
2cba438185
  1. 26
      htdocs/samples/chart_bar_stacked.html

26
htdocs/samples/chart_bar_stacked.html

@ -11,13 +11,11 @@
var chart = c3.generate({ var chart = c3.generate({
data: { data: {
columns: [ columns: [
['data1', 30, 200, 200, 400, 150, 250], ['data1', 30, 200, 200, 400, 150, -250],
['data2', 130, -100, 100, 200, 150, 50] ['data2', 130, -100, 100, 200, 150, 50],
['data3', 230, -200, 200, 300, 250, 250]
], ],
types: { type: 'bar',
data1: 'bar',
data2: 'bar'
},
groups: [ groups: [
['data1', 'data2'] ['data1', 'data2']
] ]
@ -28,6 +26,22 @@
} }
} }
}); });
setTimeout(function () {
chart.groups([['data1', 'data2', 'data3']])
}, 500);
setTimeout(function () {
chart.load({
columns: [['data4', 100, 50, 150, -200, 300, -100]]
});
}, 1000);
setTimeout(function () {
chart.groups([['data1', 'data2', 'data3', 'data4']])
}, 1500);
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save