groupWidth not working to reduce the width of bar in column chart when only one bar is present

390 views
Skip to first unread message

Sagar Varma

unread,
Sep 17, 2018, 1:59:26 AM9/17/18
to Google Visualization API
Hi,

I have a column chart, where i have two different rows and one bar in each row. in this case the width of the bars are too large and groupWodth is not working in reducing the width of bar. 
PFA screenshot for the chart. Could someone please help me in reducing the width of individual bars. Please let me know if more info is needed from my side. Below are the options i am using to draw the chart.

var options = {
    backgroundColor: 'transparent',
    legend:{position:'bottom'},
    colors:['red', 'green'],
    is3D: true,
    pointSize:5,
    vAxis: {
    gridlines:{
    color:'none'
    }
    },
    hAxis: {
    gridlines:{
    color:'none'
    }
    },
    bar:{
    groupWidth: '10%',
    gap : 30
    },
    colors:['#F3BF31','#31B2F3','orange'],
    annotations:{
    stem:{
    color:'none'
    },
    textStyle:{
    color : 'black'
    }
    }
    }

Thanks,
Venkat.
Column_Chart.PNG

Daniel LaLiberte

unread,
Sep 18, 2018, 10:09:28 PM9/18/18
to Google Visualization API
Hi Venkat,

Sounds like a bug.  There are often troublesome special cases around having only 1 or 0 data rows since the chart doesn't know how big things should be without sufficient context.  It might help to add a viewWindow option to your hAxis, with min and max values.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/7deaddb2-b25f-468f-a460-ee57a443444e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages