如何更改HighCharts.js散点图标记位置的位置

时间:2015-09-03 12:51:49

标签: javascript jquery html highcharts frontend

请参阅JSFIDDLE

我希望var x1的值(即var x1 = 10;)应该改变我改变范围滑块的时刻::

document.getElementById("range").innerHTML 

请建议。

1 个答案:

答案 0 :(得分:0)

以下是您问题的简单解决方案:

http://jsfiddle.net/La9s2cp4/5/

var chart;

function createChart(){

// Set up the chart
chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        margin: 100,
        type: 'scatter',
        options3d: {
            enabled: true,
            alpha: 10,
            beta: 30,
            depth: 250,
            viewDistance: 5,

            frame: {
                bottom: { size: 1, color: 'rgba(0,0,0,0.02)' },
                back: { size: 1, color: 'rgba(0,0,0,0.04)' },
                side: { size: 1, color: 'rgba(0,0,0,0.06)' }
            }
        }
    },
    title: {
        text: 'Draggable box'
    },
    subtitle: {
        text: 'Click and drag the plot area to rotate in space'
    },
    plotOptions: {
        scatter: {
            width: 10,
            height: 10,
            depth: 10
        }
    },
    yAxis: {
        min: 0,
        max: 10,
        title: null
    },
    xAxis: {
        min: 0,
        max: 10,
        gridLineWidth: 1
    },
    zAxis: {
        min: 0,
        max: 10,
        showFirstLabel: false
    },
    legend: {
        enabled: false
    },
    series: [{
        name: 'Reading',
        marker: {
            radius: xdata
        },
        colorByPoint: true,
        data: [dataG.data1, dataG.data2, dataG.data3]
    }]
});

}