make an example with rCharts in cleaner code