remove unneed variables from chart javascript