升级到v3.0 - 发现更多问题(3)

时间:2013-04-03 12:33:19

标签: highcharts

我已更新到v3.0并在IE9&铬。 我有一个按钮,根据找到的数据创建一个新图表。 图表比例yAxis会发生变化吗? (注意:图表是对数图表)。 有时图表会变为:

enter image description here

1 个答案:

答案 0 :(得分:0)

很抱歉没有一个真实的例子:但我在按下自定义按钮时注意到这一点(5/6次后) - 出现此问题:

注意:

1)按钮是用图表创建的 2)图表可能每5秒更新一次 - 如果数据已更改

// handle detailed chart refresh button
function showResetZoomButton(pb_detailed_chart)
{
    // load refresh images
    var ResetZoomJPG        = 'images/gallery/reset_zoom.jpg';
    var ResetZoomPressedJPG = 'images/gallery/reset_zoom_pressed.jpg';

    // add refresh (pressed) image
    var imgResetZoomPressed = pb_detailed_chart.renderer.image(ResetZoomPressedJPG, pb_detailed_chart.chartWidth-112,10,24,20);
    imgResetZoomPressed.add();
    imgResetZoomPressed.css({'cursor':'pointer'});
    imgResetZoomPressed.attr({'title':'Reset Zoom'});

    // add refresh image
    var imgResetZoom = pb_detailed_chart.renderer.image(ResetZoomJPG, pb_detailed_chart.chartWidth-112,10,24,20);
    imgResetZoom.add();
    imgResetZoom.css({'cursor':'pointer'});
    imgResetZoom.attr({'title':'Reset Zoom'});

    // init in-action/out-action for mouse event
    var inAction = "mouseover";
    var outAction = "mouseout";
    if ( $.browser.mozila )
    {
        inAction = "mouseenter"; outAction = "mouseleave";
    }

    imgResetZoom.on(inAction, function(){
        imgResetZoomPressed.show();
        imgResetZoom.hide();
    });

    imgResetZoom.on(outAction, function(){
        imgResetZoom.show();
        imgResetZoomPressed.hide();
    });

    imgResetZoomPressed.on(inAction, function(){
        imgResetZoomPressed.show();
        imgResetZoom.hide();
    });

    imgResetZoomPressed.on(outAction, function(){
        imgResetZoom.show();
        imgResetZoomPressed.hide();
    });

    // refresh chart
    imgResetZoomPressed.on('click',function(){
        // check if master found, and if real time disabled
        if (pb_master_chart && enable_lastRoundsChart_realtime == 0)
        {
            // master chart found
            // remove plotBand
            pb_master_chart.xAxis[0].removePlotBand('mask-before');
            pb_master_chart.xAxis[0].removePlotBand('mask-after');
            pb_master_chart.xAxis[0].addPlotBand({
                id: 'mask-before',
                from: -1,
                to: 99999,
                color: 'rgba(0, 0, 0, 0.2)'
            })
        }
        // reset detailed graph
        createDetail(cache_last_rounds.last_rounds_data, window.show_top_round_ids);
    });
}