I'm using Flot JS charts. I'm trying to remove one of the plot series from my data array completely with jquery or plain javascript.
This is what my data array looks like:
[
{
"label" : "Citrix PV Ethernet Adapter",
"data": [[1,0], [2,0.01], [3,0.02], [4,0.01], [5,0.01]]
},
{
"label" : "Virtual Adapter _1",
"data" : [[1,0], [2,0], [3,0], [4,0], [5,0]]
}
]
I want to be able to have the ability to completely remove one of the entries, preferably by using the "label" properties value, so it looks like this:
[
{
"label" : "Citrix PV Ethernet Adapter",
"data": [[1,0], [2,0.01], [3,0.02], [4,0.01], [5,0.01]]
}
]
Is this possible? I know it's possible to "toggle" the visibility of the series in Flot, but this doesn't suit in this case.
There could be many many entries in this array, I've just kept it to two for an example.
I've tried the playing around with javascripts delete
function but I've had no luck so far.
How can this be done?