Search code examples
javascriptknockout.jsjqplot

Colour JQPlot background based on value


I am wanting to know if there is a way to colour certain parts of the background (of the graph) based on a certain value?

At the moment I have a graph like this: Normal Graph

The two red lines are values that are inherited from the server and I don't manually define them (but for the sake of the argument, they're set at 6.5 and 8.5 respectively). Basically I am wanting to shade/colour above and below those lines. So the graph would look something like this: New Graph (Imagine the black scribbled lines are filled in).

Does anyone have any idea how to do this within the CanvasOverlay options?


Solution

  • I figured out how to do this. I simply returned a rectangle object and based the Y value off the appropriate point I needed on the axis.