Fixed an error in example javascript

The version before throws an error in Chrome telling that "topCharts.undefined" cannot be found.