I did try to use `<div id="chart_div"></div>` (without the height style), then tried to change the height from within the options, in https://jsfiddle.net/km7tq1f4/, but none of the commented height settings has any effect that I want, some are even make the graph un-render-able, what have I done wrong?
On Mon, Sep 7, 2015 at 3:50 PM, Tong Sun wrote: > Thank you Daniel for the answer. > > Yes, I figured that's how things calculated as well, but is there any > practical way to change the chartArea.height, when I'm flipping the number > of bars from my bar chart between 10 and 100 using the javascript listed in > http://jsfiddle.net/12r0ztoa/5/? > > I'm guessing, to use `<div id="chart_div"></div>` (without the height > style), then somehow magically change the chartArea.height on the fly when > changing the filter, but I'm actually without a clue how to do it as I am > not a javascript developer. > > If it is even slightly possible, I can convert > http://jsfiddle.net/12r0ztoa/5/ into a bar chart, just to give people an > easy start for showing me how to do. > > Thanks > > > On Mon, Sep 7, 2015 at 3:00 PM, 'Daniel LaLiberte' via Google > Visualization API <[email protected]> wrote: > >> Tong, >> >> The height of each bar will be approximately the height of the chartArea >> divided by the number of bars, where the chartArea is the area that the >> bars are actually drawn within, inside the axis bounds. You can set the >> chartArea.height, but keep in mind that the overall chart height is equal >> to the sum of the chartArea.height, the chartArea.top and the bottom area. >> You can't currently set the bottom area (under the chartArea), because it >> just gets the leftover space. >> >> On Mon, Sep 7, 2015 at 11:43 AM, Tong Sun wrote: >> >>> Hi, >>> >>> I have a challenging issue to overcome -- how to properly size up a >>> dynamic bar chart? I.e. to adjust its height automatically when the number >>> of rows changes dramatically. >>> >>> Here is my problem, >>> >>> My bar chart have nearly hundred of rows, and I'm using Sergey's >>> following trick to pick sections when I want. So the final chart may have >>> 10 or 100 rows, depending on the situation, which doesn't work well under a >>> fixed chart height. >>> >>> I saw controls for height of the chart, or chartArea, but what I really >>> need is the height of each bar for the bar chart. I.e., regardless whether >>> my bar chart has 10 or 100 rows, each bar in the chart will show same >>> width. The total height of the chart will grow or shrink accordingly. How >>> can it be done? >>> >>> PS. I tried to use `<div id="chart_div"></div>` so as to allow >>> google bar chart to figure out the height automatically, but the graph >>> looks really tiny -- https://jsfiddle.net/6g25g4b1/ >>> >>> Please help. >>> >>> Thanks >>> >>> >>> On Friday, February 6, 2015 at 10:07:50 AM UTC-5, Tong Sun wrote: >>>> >>>> >>>> On Fri, Feb 6, 2015 at 9:57 AM, 'Sergey Grabkovsky' via Google >>>> Visualization API wrote: >>>> >>>>> >>>>> Here's a pretty simple example of what I think you're looking for: >>>>> http://jsfiddle.net/12r0ztoa/5/ >>>>> >>>> >>>> Yes, YES! that is nice wonderful masterpiece that I can never come up >>>> with on my own. Thanks a million. I own you Sergey! >>>> >>>> >>>> -- >>> 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 >>> http://groups.google.com/group/google-visualization-api. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/google-visualization-api/234d366c-e288-4b7a-989d-cc687b2a8887%40googlegroups.com >>> <https://groups.google.com/d/msgid/google-visualization-api/234d366c-e288-4b7a-989d-cc687b2a8887%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> >> - 978-394-1058 >> [email protected] <[email protected]> 5CC, Cambridge MA >> [email protected] <[email protected]> 9 Juniper Ridge >> Road, Acton MA >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Google Visualization API" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/google-visualization-api/qVIsp_uhNNY/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To post to this group, send email to >> [email protected]. >> Visit this group at >> http://groups.google.com/group/google-visualization-api. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMwvg1YNFifh-F6tML2g3QsoAnr%3D6avqVpxq7F5PJyj7w%40mail.gmail.com >> <https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJMwvg1YNFifh-F6tML2g3QsoAnr%3D6avqVpxq7F5PJyj7w%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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 http://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAMmz1OfF5_-eZgGEoyeG1MrGDjTvbfEH3OZauT4NAK%3DmTM%3Damg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
