Search code examples
flot

How can I modify the color used for Flot zoom selection?


I've based my graph on the example shown at http://www.flotcharts.org/flot/examples/visitors/index.html and it works fine, but users are complaining that the pink color showing selection is too light for them to use it well.

I can find plenty of docs about series colors, linechart colors, but can't determine where I can modify the pink used in the example. Is this possible in the options somewhere?


Solution

  • You can change the color in the selection options:

    selection: {
        mode: null or "x" or "y" or "xy",
        color: color,
        shape: "round" or "miter" or "bevel",
        minSize: number of pixels
    }
    

    But you can't change the opacity with this, it is hardcoded to 0.4 in the flot.selection.js file in line 323. Change it there if the selection is too light.