<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<script src="https://cdn.flexmonster.com/lib/flexmonster.googlecharts.js"></script>
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div>
<h2>How to create a stacked bar chart</h2>
<p>
Flexmonster Connector for Google Charts can prepare your data for the
<a
href="https://www.flexmonster.com/doc/integration-with-google-charts/#!supported-charts"
target="_blank"
>predefined set of charts</a>. To create a chart that's not in this list,
you need to preprocess your data manually. It can be done using the
<a
href="https://www.flexmonster.com/doc/integration-with-google-charts/#!prepareDataFunction"
target="_blank"
>prepareDataFunction</a> from the Connector for Google Charts.
</p>
<p>
In this example, we've created a stacked bar chart. For this type of chart,
the data format should be an array of arrays. Check out lines 60-90 in the
JavaScript box to see how the <code>prepareDataFunction</code> is defined
for the stacked bar chart.
</p>
<p>
<a
href="https://www.flexmonster.com/doc/integration-with-google-charts/"
target="_blank"
>Visit our docs to learn more about the integration with Google Charts</a>.
</p>
</div>
<div id="pivot-container"></div>
<div id="chartContainer"></div>