Charts with filled area under the curve can be made for spline charts, line charts, or step charts using
chart.area(True)
Area Spline Chart Example
import datetime
dts = [datetime.datetime(2015, 3, 5, x) for x in [10, 11, 12, 13, 14]]
y1 = [10, 20, 30, 20, 10]
y2 = [20, 10, 30, 40, 0]
import c3pyo as c3
chart = c3.SplineChart()
chart.area(True)
chart.plot(dts, y1, label="y1")
chart.plot(dts, y2, label="y2")
chart.show()
Area Line Chart Example
x = [1, 3, 5, 7, 9, 11]
y1 = [5, 20, 50, 32, 2, 10]
y2 = [54, 12, 23, 32, 39, 10]
y3 = [10, 10, 10, 10, 10, 10]
import c3pyo as c3
chart = c3.LineChart()
chart.area(True)
chart.plot(x, y1, label="y1")
chart.plot(x, y2, label="y2")
chart.plot(x, y3, label="y3")
chart.show()
Step Chart Example
x = [1, 2, 3, 4, 5, 6, 7]
y = [i ** 2 / 2.0 for i in x]
import c3pyo as c3
chart = c3.StepChart()
chart.area(True)
chart.plot(x, y, label="(x^2)/2")
chart.show()