【问题标题】:HighCharts - Selection Event keep the selection marked in graphHighCharts - 选择事件在图表中保持选择标记
【发布时间】:2014-03-27 22:21:46
【问题描述】:

有人知道如何在 HighCharts 的图表中保存选择吗?

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

    // create the chart
    $('#container').highcharts({
        chart: {
            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: [{
            type: 'column',
            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]
        }, {
            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].reverse()
        }]
    });
});

例如:http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/events-selection/

假设一旦我选择了图表的一个区域,该区域将保持选中状态,直到用户做出新的选择或重置缩放。有什么想法吗?

【问题讨论】:

  • 你能做到吗?

标签: javascript jquery highcharts


【解决方案1】:

请参阅 Highcharts 网站的 demo - 名为 master 的底部图表正在使用 addPlotBand() 标记(取消)选定区域。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多