Also one more point is that when I hard code the data, I am getting the
width properly and the issue occurs only when I fetch data from spreadsheet
in my *google drive*
On Wednesday, June 6, 2018 at 3:08:02 PM UTC-4, New programmer wrote:
>
> Thanks for your post! I tried adding hAxis: { type: 'category' } and also
> changed the way of loading the chart but* still I am having the same thin
> bars*.
>
> I have attached the graph that I am getting. Also, my data is very small
> and is like 5-7 data is plotted in the graph
>
> On Wednesday, June 6, 2018 at 2:26:00 PM UTC-4, Daniel LaLiberte wrote:
>>
>> Since you left out your data, we can't help much, but you probably have
>> more than one row with the same domain value or very close values, which
>> causes the bars to be the minimum width of 1.
>>
>> If you want each domain value to be treated discretely, not using
>> continuous axis values, then convert your domain data to strings, or add
>> hAxis: { type: 'category' }
>>
>> You should also switch to the newer versions by changing how you load
>> Google Charts. See
>> https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code
>>
>> On Wed, Jun 6, 2018 at 1:54 PM New programmer <[email protected]> wrote:
>>
>>> here is the code that I have been using if it could help anyone figure
>>> out *where I am going wrong*:
>>>
>>> <!DOCTYPE html>
>>> <html>
>>> <head>
>>> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
>>> <title>Commuter Calculator</title>
>>>
>>> <script type="text/javascript" src="https://www.google.com/jsapi">
>>> </script>
>>>
>>> <script type="text/javascript">
>>> google.load("visualization", "1", {packages:["corechart"]});
>>>
>>> function initialize() {
>>> var opts = {sendMethod: 'auto'};
>>> // Replace the data source URL on next line with your data
>>> source URL.
>>> var query = new google.visualization.Query('url……goes….. here',
>>> opts);
>>>
>>> // Optional request to return only column C .
>>> query.setQuery('select C');
>>>
>>> // Send the query with a callback function.
>>> query.send(handleQueryResponse);
>>> }
>>>
>>> function handleQueryResponse(response) {
>>> if (response.isError()) {
>>> alert('Error in query: ' + response.getMessage() + ' ' +
>>> response.getDetailedMessage());
>>> return;
>>> }
>>>
>>> var data = response.getDataTable();
>>>
>>> var options = {
>>> title: 'Company Performance',
>>> bar: {
>>> groupWidth: 30
>>> }
>>>
>>>
>>> };
>>>
>>> var chart = new
>>> google.visualization.ColumnChart(document.getElementById('chart_div'));
>>> chart.draw(data, options);
>>> }
>>>
>>> google.setOnLoadCallback(initialize);
>>>
>>> </script>
>>> </head>
>>>
>>> <body>
>>> <div id="chart_div" style="width: 800px; height: 500px; align:
>>> center"></div>
>>> </body>
>>> </html>
>>>
>>> --
>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> 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/6fc7a6fa-1c8f-455a-b815-52f963b0527d%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/google-visualization-api/6fc7a6fa-1c8f-455a-b815-52f963b0527d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>> [email protected] 5CC, Cambridge MA
>>
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/14c824db-8f25-43aa-8f60-1b809122f938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.