Fix JS errors setting unit/scale on graph creation