2016-09-21 76 views
-1

我有一個柱狀圖,我需要刷新(重新繪製)它,點擊按鈕。如何更新按鈕上的highcart柱狀圖點擊

這是代碼,當我加載頁面我加載:

function setParetoChart(data) { 
    $('#liveChart2').highcharts({ 
     chart: { 
      type: 'column' 
     }, 
     title: { 
      text: 'Detail' 
     }, 
     subtitle: { 
      text: 'Detail' 
     }, 
     xAxis: { 
      type: 'category' 
     }, 
     yAxis: { 
      title: { 
       text: 'Totale Detail' 
      } 

     }, 
     legend: { 
      enabled: false 
     }, 
     plotOptions: { 
      series: { 
       cursor: "pointer", 
       point: {.... 
         }, 
         borderWidth: 0, 
         dataLabels: { 
          enabled: true, 
          format: '{point.y:.1f}%' 
         } 
        } 
       } 
      } 
     }, 

     tooltip: { 
      headerFormat: '<span style="font-size:11px">{series.name}</span><br>', 
      pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> del Totale<br/>Numero Pezzi Scarti: <span style="color:{point.color}"></span>: <b>{point.scarti}</b> ' 
     }, 

     series: [{ 
      name: 'Details', 
      colorByPoint: true, 
      data: data 
     }] 
    }); 

} 

現在,就按一下按鈕,我從Ajax功能,即返回對象的數組,以這種方式獲取數據;

drilldown: 'var1' 
name: 'var1' 
scarts: 15, 
y; 15 

..並與對象的數組,我需要重繪我的柱形圖..

回答