Made the legend configurable by changing the constant COLOUR_GRADES_MAX_VALUE