user1016195
user1016195

Reputation: 153

how to implement multiple point data selection in highcharts?

 $(function () {
    var $report = $('#report');

    // create the chart
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            events: {
                selection: function(event) {
                    if (event.xAxis) {
                        $report.html('min: '+ event.xAxis[0].min +', max: '+ event.xAxis[0].max);
                    } else {
                        $report.html ('Selection reset');
                    }
                }
            },
            zoomType: 'x'
        },
        xAxis: {
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
        }]
    });
});  

This is sample code. I want to select at least two points in pin mode. It contain only zooming data after selection. In high charts there is multiple point selection available? Pls help

Upvotes: 0

Views: 5489

Answers (1)

Rob Willis
Rob Willis

Reputation: 4844

Highcharts offers multi-selection via the allowPointSelect option:

e.g. For a Column Chart:

var chart = new Highcharts.Chart({
    plotOptions: {
        column: { allowPointSelect: true }
    }
});

Shift + Left Mouse Click Or Ctrl + Left Mouse Click will multi-select points.

Examples for other chart types are available in the Highcharts API Documentation

Upvotes: 1

Related Questions