I have a global array that stores more arrays inside. The internal arrays store two values, the x and y of the position of a graph.
Well then, with that said, I explain how it works for now and what I need.
I have (for now, in the future it will be more) two checkboxes, when they are activated I save the data that is mentioned in the checkbox inside the parent array. This data is an Array with two values (as I said before). Adding them is not a problem, use push
and that's it, the problem is to eliminate them when a checkbox is deselected.
I have this code:
//Checkbox para mostrar data eaepunt1
$("#eae").change(function()
{
mostrarDatos();
});
//Checkbox para mostrar data arabpunt1
$("#arab").change(function()
{
mostrarDatos();
});
function mostrarDatos(){
if($(eae).prop('checked') == true)
{
totaldata.push(eaepunt1[coundata])
}
else
{
//Borrar los datos del checkbox
}
if($(arab).prop('checked') == true)
{
totaldata.push(arabpunt1[coundata])
}
else
{
//Borrar datos del checkbox
}
gr_html.series[0].data = totaldata;
gr_html.redraw();
}
At first you could empty the parent Array and re-fill it every time I run the function, but it seems like a bit of a "sloppy" solution. How should I do it?