问题
I'm using jqPlot to render a graph with zooming enabled.
For example:
http://www.jqplot.com/tests/zooming.php
In the example above, when you make a selection on the graph, the graph canvas is painted in grey (apart from the selection). Does anyone know how to customise this colour?
I've been unable to find which jqPlot CSS option to tweak in jquery.jqplot.css.
回答1:
I am afraid that no css is involved in this particular process of painting. Though there is one class which can point you in the right direction. My suspect is the jqplot-zoom-canvas
class. Though I think that the painting is defaulted to grey.
Thus, I see only two options:
- Changing the painting directly in the jqplot script.
- Or on painting of zoom selection start change the colour of the
jqplot-zoom-canvas
then change it back to default on painting zoom stop. But I do not know if there are hooks for these sort of events. Therefore, you might actually be left with only the option no. 1.
来源:https://stackoverflow.com/questions/10334135/jqplot-how-to-change-background-colour-when-selecting-range-on-graph