updated code to reflect latest refactor nightcharts