Sunday, June 17, 2012

Google Chart API Shows Only One Chart

Problem:
When using Google Charts, a single chart is shown despite adding multiple charts.

Solution:
The <div> element is a non-void(non-empty) element and should not be self closed.

Single graph shows:
  <div id="month_type" class="chg_chart"/>
  <div id="month_cat" class="chg_chart"/>
  <div id="month_region" class="chg_chart"/>

Three graphs show:
  <div id="month_type" class="chg_chart"></div>
  <div id="month_cat" class="chg_chart"></div>
  <div id="month_region" class="chg_chart"></div>


References:
  1. stackoverflow: is it possible to have multiple google charts in one page?

No comments:

Post a Comment