Googlebarchart를 작성합니다. 데이터베이스에서 데이터를 가져옵니다. 문제는 데이터에 0.6,0.7 등의 '1'값이 있음을 나타냅니다. 그래프에 표시되지 않습니다. 그래프는 당신의 가치는 당신이 true
에 로그 스케일 설정 옵션 hAxis.logScale
을 사용할 수있는 모든 긍정적 인 경우 1.Google BarChart 십진수 값이 표시되지 않습니다.
<script type="text/javascript">
google.load('visualization', '1', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable(<?php echo $jsonTable; ?>);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, {
type: 'string',
role: 'annotation',
sourceColumn: 1,
calc: 'stringify'
}]);
var options = {
width: 395,
height: 200,
title: 'Values',
'chartArea': {right: 37,width:'40%'},
titleTextStyle: {
fontName: 'Arial',
fontSize: 14
},
legend: {position: 'none'},
colors:['#4A9218'],
};
var chart = new google.visualization.BarChart(document.getElementById('ch7'));
chart.draw(view, options);
}
</script>
<div id="ch7" style="width:33%; height:200px"></div>
업데이트와 같은'문제를 보여줍니다. 나는이 코드를 기반으로 한 바이올린을 만들었고 나를 위해 잘 작동하는 것 같다. http://jsfiddle.net/asgallant/YhG4y/ –
asgallant