2017-11-09 1 views
1

는 :제거 줌 버튼은 내 Google 주석 차트에 줌 메뉴에서 1 시간, 1D, 5D를 제거하기 위해 노력하고있어

enter image description here

내가가는 길을 표시 한 게시물을 발견 이 작업을 수행하려면 chart.draw 함수에 다음을 추가하면되지만 아무 것도하지 않습니다. 제발 조언. 당신이 사용할 수있는

chart.draw(data, options); 
    $("#chart_div_AnnotationChart_zoomControlContainer_hour").remove(); 
    $("#chart_div_AnnotationChart_zoomControlContainer_day").remove();}; 

답변

1

차트 옵션 ->

var options = { 
    displayZoomButtons: false 
}; 

이 작업 조각을 다음을 참조 displayZoomButtons

...

google.charts.load('current', { 
 
    packages: ['annotationchart'] 
 
}).then(function() { 
 
    var data = new google.visualization.DataTable(); 
 
    data.addColumn('date', 'Date'); 
 
    data.addColumn('number', 'WTI'); 
 
    data.addColumn('number', 'Nat Gas FOB US'); 
 
    data.addRows([ 
 
    [new Date(2015, 0, 1), 5, null], 
 
    [new Date(2015, 0, 4), 1, null], 
 
    [new Date(2015, 0, 7), 3, null], 
 
    [new Date(2015, 0, 10), 5, null], 
 
    [new Date(2015, 0, 13), 3, null], 
 
    [new Date(2015, 0, 16), 7, null], 
 
    [new Date(2015, 0, 19), 3, null], 
 
    [new Date(2015, 0, 22), 4, null], 
 
    [new Date(2015, 0, 25), 9, null], 
 
    [new Date(2015, 0, 28), 8, null], 
 
    [new Date(2015, 0, 31), 6, null] 
 
    ]); 
 

 
    var options = { 
 
    displayZoomButtons: false 
 
    }; 
 

 
    var chart = new google.visualization.AnnotationChart(document.getElementById('chart_div')); 
 
    chart.draw(data, options); 
 
});
<script src="https://www.gstatic.com/charts/loader.js"></script> 
 
<div id="chart_div"></div>

+0

우수! 매우 감사합니다! 그들이 나를 허용하자마자 대답을 받아 들일 것입니다. 건배! –