Duplicated Numbers on Google Charts Vertical Axis

google-visualization

Solution

I was facing same issue when we have less number of boxes (let say 1 or 2). I resolved it with maxValue option. Just add maxValue = 4 option in your vaxis. It will add 5 (0 to 4) gridlines at all times. If your maxValue is more that 4, it will adjust automatically. Mine is working fine with options (title : 'No of boxes', format : '#', minValue:0, maxValue :4). minValue = 0 will not allow negatives as its no of boxes.

Problem

I was working on a bugfix with Google visualizations for a combo (column/line) chart when one of the axes went strange and started repeating numbers ( ie: 1, 1, 2, 2 instead of 1, 2, 3, 4). Please see the image below (source: rackcdn.com) Here are the chart option settings: ``` // Instantiate and draw our chart, passing in some options. var frequency_by_day_options = { vAxes: [ {format:'#,###', title:"Call Volume"}, {format: '#%', title:'Missed Call Rate', viewWindow:{ max:1, }} ], legend: {position: 'none'}, chartArea: { height:'60%', width:'60%'}, width: 800, height: 350, backgroundColor: 'transparent', bar: { groupWidth: '90%'}, isStacked: true, seriesType: 'bars', series: {0: {type:'bar', targetAxisIndex:0}, 1: {type:'line', targetAxisIndex:1},}, colors: ['blue', 'green'], animation:{ duration: 1000, easing: 'out',}, }; ``` I have no idea what's going on here. Even when I comment out all of the vAxis options I still observe this behavior. Any ideas on what i'm doing wrong? This is driving me nuts :)

Original source