2014-07-07 2 views
1

내 차트에서 값을 dinamically 변경하는 양식을 만들었습니다. 제목, 자막 등을 바꿀 수는 있지만 ... 활성화 또는 비활성화 된 3D 모드를 설정하려면 어떻게해야합니까? 내가 API Documentation에서 찾고했지만 나는 아무것도 찾지 못했습니다Highcharts로 3D 모드 활성화/비활성화 설정

chart = new Highcharts.Chart({ 
    chart: { 
     renderTo: 'container', 
     marginRight: 0, 
     events: { 
      load: function() { 
       this.credits.element.onclick = function() { 
        window.open('http://www.url.com', '_blank'); 
       } 
      } 
     }, 
     marginTop: 80, 
     type: 'column', 
     options3d: { 
      enabled: true, 
      alpha: 15, 
      beta: 15, 
      viewDistance: 25, 
      depth: 90 
     } 
    }, 
    plotOptions: { 
     column: { 
      depth: 90 
     } 
    }, 
    credits: { 
     enabled: true, 
     text: 'MyWeb.com', 
     style: { 
      cursor: 'pointer', 
      color: '#909090', 
      fontSize: '10px' 
     } 
    }, 
    title: { 
     text: 'Población Mundial' 
    }, 
    subtitle: { 
     text: 'Fuente: Wikipedia.org' 
    }, 
    xAxis: { 
     title: { 
      text: 'Continentes' 
     }, 
     categories: ['Africa', 'América', 'Asia', 'Europa', 'Oceanía'] 
    }, 
    yAxis: { 
     title: { 
      text: 'Población (millones)' 
     }, 
    }, 
    series: [{ 
     name: 'Año 1800', 
     data: [107, 31, 635, 203, 2] 
    }] 
}); 

:

$(document).ready(function() { 

    //Title inputText 
    $('#gra_title').blur(function(){ 
     chart.setTitle({ text: $('#gra_title').attr("value") }); 
    }); 

    //Subtitle inputText 
    $('#gra_subtitle').blur(function(){ 
     chart.setTitle(null, { text: $('#gra_subtitle').attr("value") }); 
    }); 

    //Credits checkbox 
    $('#gra_credits_visible').click(function() { 
     if ($('#gra_credits_visible').is(':checked')){ 
      chart.credits.show(); 
     }else{ 
      chart.credits.hide(); 
     } 
    }); 

......... //More events to change chart 

    //3D checkbox - MY PERSONAL BUG 
    $('#gra_3d_visible').click(function() { 
     if ($('#gra_3d_visible').is(':checked')){ 
      chart.options.chart.options3d.enabled = true; 
     }else{ 
      chart.options.chart.options3d.enabled = false; 
     } 
     chart.redraw(); 
     // return TRUE or FALSE, but don't change 3D/2D mode 
     alert(chart.options.chart.options3d.enabled); 
    }); 


}); 

내 차트입니다.

답변

2

차트를 파괴하고 생성해야하므로 3D에 대한 업데이트 옵션을 사용할 수 없습니다.

+0

괜찮습니다! 나는 깊이, 알파를 바꿨다. 그러나 나는 무능하게 할 수 없었다. 버그인지 아닌지는 몰랐습니다. 감사!!! – Andynedine