当可拖动框(3d)旋转时,是否可以旋转标题(在轴上)?

时间:2015-01-31 11:58:27

标签: highcharts

我试图更改图形中的某些内容" 3D散点图可拖动框"

http://www.highcharts.com/demo/3d-scatter-draggable/grid-light

是否可以为轴添加标题,但是当我转动框时它会旋转?

现在,如果我以这种方式添加标题:

yAxis: {
    title: {
            text: "Latitude"
           }    
       },

当我旋转框时,标题不会跟随yAxis ....

这是旋转图表的代码:

     $(chart.container).bind('mousedown.hc touchstart.hc', function (e) {
                    e = chart.pointer.normalize(e);
            var posX = e.pageX,
            posY = e.pageY,
            alpha = chart.options.chart.options3d.alpha,
            beta = chart.options.chart.options3d.beta,
            newAlpha,
            newBeta,
            sensitivity = 5; // lower is more sensitive

            $(document).bind({
                'mousemove.hc touchdrag.hc': function (e) {
                    // Run beta
                    newBeta = beta + (posX - e.pageX) / sensitivity;
                    newBeta = Math.min(100, Math.max(-100, newBeta));
                    chart.options.chart.options3d.beta = newBeta;

                    // Run alpha
                    newAlpha = alpha + (e.pageY - posY) / sensitivity;
                    newAlpha = Math.min(100, Math.max(-100, newAlpha));
                    chart.options.chart.options3d.alpha = newAlpha;

                    window.alphaOn3dGraph = newAlpha;
                    window.betaOn3dGraph = newBeta;

                    chart.redraw(false);
                },
                'mouseup touchend': function () {
                    $(document).unbind('.hc');
                }
            });
        });

0 个答案:

没有答案