pygal

Documentation

Interpolations

Without interpolation:

interpolate

chart = pygal.Line()
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

With cubic interpolation:

interpolate

chart = pygal.Line(interpolate='cubic')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

With quadratic interpolation:

interpolate

chart = pygal.Line(interpolate='quadratic')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

With lagrange interpolation:

interpolate

chart = pygal.Line(interpolate='lagrange')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

With trigonometric interpolation:

interpolate

chart = pygal.Line(interpolate='trigonometric')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

With hermite interpolation:

interpolate

chart = pygal.Line(interpolate='hermite')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

For hermite you can also pass additionnal parameters to configure tangent behaviour:

chart = pygal.Line(interpolate='hermite', interpolation_parameters={'type': 'finite_difference'})
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()
chart = pygal.Line(interpolate='hermite', interpolation_parameters={'type': 'cardinal', 'c': .75})
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()
chart = pygal.Line(interpolate='hermite', interpolation_parameters={'type': 'kochanek_bartels', 'b': -1, 'c': 1, 't': 1})
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

For more information see the wikipedia article

Interpolation precision

interpolation_precision

You can change the resolution of the interpolation with the help of interpolation_precision:

chart = pygal.Line(interpolate='quadratic')
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()
chart = pygal.Line(interpolate='quadratic', interpolation_precision=3)
chart.add('line', [1, 5, 17, 12, 5, 10])
chart.render()

Next: Sparklines