make the chart javascript shared between both pages now