4 – To apply the gradient, in your graph go to the Presentation window -> Colors and Legend -> Colors Customize by expression. In the check box, leave the option selected as shown below:
5 – Finally, in the expression insert your calculation within the ColorMix2() function.