typpo / google-charts-node

Render Google Charts to image
GNU Affero General Public License v3.0
35 stars 10 forks source link

Guage chart is giving not a constructor error #9

Closed stardev24 closed 3 years ago

stardev24 commented 3 years ago

As per the given documentation I have added guage in packages array.

     const image = await GoogleChartsNode.render(drawChart, {
                        width: 400,
                        height: 300,
                        packages:['gauge']
          });

And draw function is given as

function drawChart() {

    var data = google.visualization.arrayToDataTable([
        ['Label', 'Value'],
        ['Memory', 80]
      ]);

      var options = {
        width: 400, height: 120,
        redFrom: 90, redTo: 100,
        yellowFrom:75, yellowTo: 90,
        minorTicks: 5
      };

    const chart = new google.visualization.Guage(container);
    chart.draw(data, options);
  }

But If I try to access it from express server I am getting

Page error: Error: TypeError: google.visualization.Guage is not a constructor. Please help

GuageChartError

typpo commented 3 years ago

You're spelling Gauge wrong. Gauge, not Guage