Hi Nick,

The isStacked option is a classic chart option, and doesn't work directly
for Material charts. You'll have to call
google.charts.Bar.convertOptions(options) in order to convert the classic
options to Material. Here's the relevant excerpt from our documentation:

The Material Charts are in beta. The appearance and interactivity are
largely final, but the way options are declared is not. If you are
converting a Classic Bar Chart to a Material Bar Chart, you'll want to
replace this line:

chart.draw(data, options);
...with this:
chart.draw(data, google.charts.Bar.convertOptions(options));

On Mon, Aug 31, 2015 at 9:16 PM Nick Robinson <[email protected]> wrote:

> Hi there,
>
> This might seem like a silly question but I'm trying to create a simple
> stacked bar chart (exactly the same as the one on the google charts
> "stacked bar charts" example), however, the option isStacked: true doesn't
> seem to do anything:
>
> <html>
>   <head>
>     <script type="text/javascript" src="https://www.google.com/jsapi
> "></script>
>     <script type="text/javascript">
>       google.load("visualization", "1.1", {packages:["bar"]});
>       google.setOnLoadCallback(drawChart);
>       function drawChart() {
> var data = google.visualization.arrayToDataTable([
>   ['Genre', 'Fantasy & Sci Fi', 'Romance', 'Mystery/Crime', 'General',
>   'Western', 'Literature', { role: 'annotation' } ],
>   ['2010', 10, 24, 20, 32, 18, 5, ''],
>   ['2020', 16, 22, 23, 30, 16, 9, ''],
>   ['2030', 28, 19, 29, 30, 12, 13, '']
> ]);
>
>       var options = {
>         width: 600,
>         height: 400,
>         legend: { position: 'top', maxLines: 3 },
>         bar: { groupWidth: '75%' },
>         isStacked: true
>       };
>
>       var chart = new
> google.charts.Bar(document.getElementById('barchart_stacked'));
>
>       chart.draw(data, options);
>     }
>     </script>
>   </head>
>   <body>
>     <div id="barchart_stacked" style="width: 900px; height: 500px;"></div>
>   </body>
> </html>
>
> Thanks in advance for any assistance
>
> --
> 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/7197aa56-7f66-4667-9f8b-c44e1897be00%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/7197aa56-7f66-4667-9f8b-c44e1897be00%40googlegroups.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/CAEwwup4yMBOxXLnUqwvqGtGpSA8FSUgRqZtsxt94_PiHKi2t0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to