countries = ['USA', 'GB', 'China', 'Russia', 'Germany'] bronzes = [38, 17, 26, 19, 15] silvers = [37, 23, 18, 18, 10] golds = [46, 27, 26, 19, 17] import c3pyo as c3 chart = c3.BarChart() chart.plot(bronzes, color='#CD853F', label='Bronzes') chart.plot(silvers, color='Silver', label='Silvers') chart.plot(golds, color='GoldenRod', label='Golds') chart.stacked(True) chart.set_xticklabels(countries) chart.ylabel('Medals at 2016 Olympics') chart.show()
Stacked Bar Charts
Stacked Bar Charts using C3PyO
The data plotted first is stacked at the bottom by default.