google-charts icon indicating copy to clipboard operation
google-charts copied to clipboard

ERROR TypeError: Cannot read property 'visualization' of undefined

Open ghost opened this issue 6 years ago • 9 comments

ghost avatar Apr 09 '18 23:04 ghost

+1

simonepozzobon avatar May 15 '18 10:05 simonepozzobon

+1

anirudhmaddy avatar Sep 25 '18 18:09 anirudhmaddy

Same problem here.

vark47 avatar Oct 10 '18 17:10 vark47

can anyone provide a repository or gist with this issue in it?

mmathias01 avatar Jan 11 '19 05:01 mmathias01

+1

anoblet avatar Feb 14 '19 14:02 anoblet

https://gist.github.com/anoblet/b0a0d5d4c608d8c52c64e20dd9bd8bbd

anoblet avatar Feb 14 '19 14:02 anoblet

It has to do with google-charts not having any typings.

anoblet avatar Feb 14 '19 14:02 anoblet

+1

chaskas avatar Feb 18 '19 20:02 chaskas

+1: I've run

npm i -D google-charts

and trying this example:

import {GoogleCharts} from 'google-charts';

//Load the charts library with a callback
GoogleCharts.load(drawChart);

function drawChart() {

    // Standard google charts functionality is available as GoogleCharts.api after load
    const data = GoogleCharts.api.visualization.arrayToDataTable([
        ['Chart thing', 'Chart amount'],
        ['Lorem ipsum', 60],
        ['Dolor sit', 22],
        ['Sit amet', 18]
    ]);
    const pie_1_chart = new GoogleCharts.api.visualization.PieChart(document.getElementById('chart1'));
    pie_1_chart.draw(data);
}

It throws: Uncaught TypeError: Cannot read property 'visualization' of undefined

linslin avatar Sep 01 '20 09:09 linslin