Highcharts交互式样条曲线

时间:2016-10-12 18:16:28

标签: charts highcharts interactive

我对高图数据有疑问。我想制作一个可拖动的图表来控制一个LED。但是我不知道如何在拖动线后存储整个数据系列。

$(function () {
    $('#container').highcharts({
        chart: {
        renderTo: 'chart-container',
        animation: false
    },

    xAxis: {
        categories: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
    },

    plotOptions: {
        series: {
            cursor: 'ns-resize',
            point: {
                events: {
                    drop: function() {
                        $('#drop').html(
                            'In <b>' + this.series.name + '</b>, <b>' +
                            this.category + '</b> was set to <b>' + 
                            this.data + '</b>'
                        );
                    }
                },
            },
            stickyTracking: false
        },
        column: {
            stacking: 'normal'
        }
    },

    tooltip: {
        yDecimals: 2
    },

    series: [{
        data: [71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 194.1, 95.6],
        //draggableX: true,
        draggableY: true,
            dragMaxY: 250,
        dragMinY: 0,
        type: 'spline',
        minPointLength: 2
    }]

    });
});

0 个答案:

没有答案