Potree Elevation Gradient Displays One Color Only

I am using Potree to display a point cloud. I want to be able to apply the gradient attribute with the pointColorType as elevation – so that the gradient corresponds to each points elevation value.

My problem is that only one colour of the gradient is applied to the point cloud. I have tried changing the gradient step values and it does change the colour but still only displays one of the gradient colours e.g. for the rainbow gradient it only displays the first blue value for all points.

Is there any way to change the gradient to define the steps for very small changes in elevation?

Code:

  points.add(pointcloud);
  let material = pointcloud.material;
  material.pointColorType = Potree.PointColorType.ELEVATION
  material.gradient = Potree.Gradients.RAINBOW;