google / google-visualization-issues

288 stars 35 forks source link

Bug: Maximum entry limit for bar chart function with slider #1038

Open orwant opened 9 years ago

orwant commented 9 years ago
Bar chart with slider function will only plot a maximum of 15 entries.  I want to show
all provinces but the chart will not show after adding any entry bellow inner mongolia.
 I tried adjusting the size.

--------
/<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>
      Google Visualization API Sample
    </title>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load('visualization', '1.1', {packages: ['controls']});
    </script>
    <script type="text/javascript">
      function drawVisualization() {
        // Prepare the data
        var data = google.visualization.arrayToDataTable([
          ['Province', 'Planned', 'Actual'],
          ['Anhui' , 10674, 6477],
          ['Beijing', 2500, 2525],
          ['Chongqing', 6449, 2887],
          ['Fujian', 4234, 2002],
          ['Gansu', 2420, 1555],
          ['Guangdong', 7504, 4570],
      ['Guangxi', 5002, 2846],
          ['Guizhou', 4544, 1636],
      ['Hainan', 1564, 1491],
          ['Hebei', 10826, 5716],
          ['Heilongjiang', 8753, 5261],
          ['Henan', 7372, 5795],
          ['Hubei', 5548, 3776],
          ['Hunan', 3180, 3846],
          ['Inner Mongolia', 10489, 4602]
          ['Jiangsu', 13010, 12862],
          ['Jiangxi', 4391, 3194],
          ['Jilin', 5565, 2965],
          ['Liaoning', 12708, 9448],
          ['Ningxia', 1787, 1467],
          ['Qinghai', 835, 643],
      ['Shaanxi', 3466, 2347],
          ['Shandong', 18165, 12227],
          ['Shanghai', 1100, 1162],
          ['Shanxi', 4730, 1961],
          ['Sichuan', 8160, 6129],
          ['Tianjin', 1740, 2364],
          ['Tibet', 4822, 3788],
          ['Yunnan', 4970, 2929],
          ['Zhejiang', 8240, 6911],
        ]);

        // Define a NumberRangeFilter slider control for the 'GDP Growth Rate' column.
        var slider = new google.visualization.ControlWrapper({
          'controlType': 'NumberRangeFilter',
          'containerId': 'control1',
          'options': {
            'filterColumnLabel': 'Planned',
            'minValue': 500,
            'maxValue': 20000
          }
        });

        // Define a bar chart
        var barChart = new google.visualization.ChartWrapper({
          'chartType': 'BarChart',
          'containerId': 'chart1',
          'options': {
            'width': 800,
            'height': 2000,
            'hAxis': {'minValue': 0, 'maxValue': 2000},
            'chartArea': {top: 0, right: 0, bottom: 0}
          }
        });

        // Create the dashboard.
        var dashboard = new google.visualization.Dashboard(document.getElementById('dashboard')).
          // Configure the slider to affect the bar chart
          bind(slider, barChart).
          // Draw the dashboard
          draw(data);
      }

      google.setOnLoadCallback(drawVisualization);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="dashboard">
      <table>
        <tr style='vertical-align: top'>
          <td style='width: 300px; font-size: 0.9em;'>
            <div id="control1"></div>
            <div id="control2"></div>
            <div id="control3"></div>
          </td>
          <td style='width: 600px'>
            <div style="float: left;" id="chart1"></div>
            <div style="float: left;" id="chart2"></div>
            <div style="float: left;" id="chart3"></div>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by marcelbaumler on 2012-10-01 04:07:24

orwant commented 9 years ago
This isn't a bug. There is a syntax error in your dataTable. There should be a comma
after your entry for 'Inner Mongolia'.

...
['Inner Mongolia', 10489, 4602],
...

Original issue reported on code.google.com by robert.mccone on 2012-10-26 21:22:32