HAxis line disappears on certain value

23 views
Skip to first unread message

Jeff Poslinski

unread,
Jun 16, 2018, 4:51:09 AM6/16/18
to Google Visualization API
Hi all,

I notice that hAxis line suddenly disappears on certain value. Initial snippets:

google.charts.load('current', {packages: ['corechart']});
google
.charts.setOnLoadCallback(drawChart);

function drawChart()
{
 
var data = google.visualization.arrayToDataTable
 
([
   
['Item', 'Percentage', {role: 'style'}],
   
['Item 1', 0.429, '#00FF00'],
   
['Item 2', 0.286, '#00FF00'],
   
['Item 3', 0.0286, '#00FF00']
 
]);
 
 
var options =
 
{
  legend
: {position: 'none'},
    hAxis
: {textPosition: 'none', gridlines:{color: 'none'}}
 
};
 
 
var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
  chart
.draw(data, options);
}

Below is the chart:

If I change the value of 'Item 3' to 0.286 the chart becomes:


Not sure what causes this behavior. Any help would be greatly appreciated.

Thanks,
Jeff

Jeff Poslinski

unread,
Jun 16, 2018, 11:48:14 AM6/16/18
to Google Visualization API
Hi all,

Adding minValue in option seems to resolve the problem.

Thanks & Regards,
Jeff
Reply all
Reply to author
Forward
0 new messages