Issue #20715: Separated the chart code into a separate js file