Forum Academy Marketplace Showcase Pricing Features

[Solved] Google Chart- HTML element does not appearing


Im trying to create basic chart , using Google Chart embedded in the HTML element. But from what ever reason its doesn’t appear in the preview. (Although if im using JSfiddle it does work)

The code is very basic code:(and based on template i found at the forum)

    <script type="text/javascript">
	   var results = [];
	   var x = [5,7,8];
	   var y = [3,6,7];

results.push (['labelx', 'label y']);

		for (i = 0; i < x.length; i++) {

      google.charts.load('current', {'packages':['corechart']});
      function drawChart() {
        var data = google.visualization.arrayToDataTable(results);

        var options = {
          title: 'test',
	  curveType: 'function',

        var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));

        chart.draw(data, options);
    <div id="curve_chart" style="width: 600px; height: 400px;"></div>

link to the application

Any help will be highly appricated

I added some missing code to your page header to load the chart.

<script type="text/javascript" src=""></script>
    <script type="text/javascript">

Great Thanks highly appreciated !!! :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.