Added the example code from the chart wiki,

with some changes.