0
votes

Scenario: I have some charts with only one series on them, and I also have some charts that have two or more series on them.

I'm trying to make it to where on the charts with multiple (2+) series on them that I am able to choose which series I would like to be selected.

The reason I need this is because if there are spikes on one set of data and not the other then I would like to remove only the data specific to the spike.

UPDATE: I have a selection event set in place that will select points and the zoomType is x only. So when I drag to select it will select the points from both series. I have found the 'showCheckBox' option, but it still selects both series regardless of which checkbox is selected. Is there a flag to check if a specific series checkbox is selected?

1
How is that different from what the legend already does for you? - Sualkcin
So what is your goal, please replicate it as live demo. - Sebastian Bochan

1 Answers

0
votes

I figured out how.

for (var i = 0; i < this.series.length; i++)    //Iterate through all the series on the chart
{
    if(this.series[i].selected)    //If the series is selected in the legend
    {
        var points = this.series[i].points;   //Retrieve all points within this certain series that are visible
        var xs = event.xAxis[0];    //Get the xAxis size
        $.each(points, function (i,p) { //For all the points visible in the series
            if (p.x >= xs.min && p.x <= xs.max) {   //Boundary check the selected points
                p.select(true, true);   //Set the selected points to selected
            }
        });
    }
}

I also set 'plotOptions->series->showCheckbox: true'