2012-04-01 77 views
1

我正在構建一個儀表板,它在一行上有大約4個圖形,並且點擊任何圖形時,我想更新另一個圖形,這個圖形的大小更大以顯示圖形,以便它對用戶可見分析。Highcharts點擊加載圖表

任何想法如何重新繪製地圖點擊按鈕。

enter image description here

回答

4

我做了類似的事情,在我的項目。

您可以添加一個按鈕縮放/彈出,單擊它將打開一個新的大圖並禁用此新圖表中的導出按鈕。

以下是完整的代碼。

function callback($this) { 
    var img = $this.renderer.image('images/zoom_icon.png', $this.chartWidth - 40, 5, 40, 12); 
    img.add(); 
    img.css({ 
     'cursor': 'pointer' 
    }); 
    img.attr({ 
     'title': 'Pop out chart' 
    }); 
    img.on('click', function() { 
     var params = { 
      chart: { 
       spacingLeft: 100, 
       spacingRight: 100, 
       renderTo: 'myChart' 
      }, 
      title: { 
       text: 'title' 
      }, 
      exporting: { 
       buttons: { 
        exportButton: { 
         enabled: false 
        }, 
        printButton: { 
         enabled: false 
        } 

       } 
      } 

     } 

     new Highcharts.Chart(params, function (chart) {}); 
    }) 

} 


new Highcharts.Chart(charts.params, callback); 

// where charts.params is object which contains options for chart