How to select weekends with flot using selection plugin?

The goal:
To get selected weekends highlighted, for selected week for example the good people at wordpress did exactly what i am trying to do here is an image enter image description here

They are using the same plugin that I am using located here, I looked through the source code at there github page but no luck. a lot of the files got renamed to wordpress convention which makes it a bit tricky to navigate.

Read More

What i got completed:
I can select any date range using

plot.setSelection({ 
    xaxis: {
        from: 0, to: 2 
    }
});

But I am not able to select multiple weekends. I have the array from the back-end code returning the selected weekends, I am not sure how to let the plugin know how to accept the array.

Related posts

Leave a Reply

1 comment

  1. I think you’re looking for markings:

    grid: 
    {
        markings: [
            { xaxis: { from:  2, to: 4 }, color: "#eeeeee" },
            { xaxis: { from:  8, to: 12 }, color: "#eeeeee" }
        ]
    }