Fixed the d3 max issue where the gradient never changed