question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng2-google-charts not working

See original GitHub issue

I followed the instruction mentioned in readme file. But, still I am not able to integrate the charts successfully with my project.

  1. Ran npm i --save ng2-google-charts.
  2. Imported the Ng2GoogleChartsModule in your app.module.ts.
  3. Used the same markup and data in .ts file as shown in example.

Following is the error that I am getting.

Can't bind to 'data' since it isn't a known property of 'google-chart'.
1. If 'google-chart' is an Angular component and it has 'data' input, then verify that it is part of this module.
2. If 'google-chart' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
 ("
        <div class="col-sm-12">
            <h2>Gaugh Chart</h2>
            <google-chart [ERROR ->][data]="pieChartOptions"></google-chart>
        </div>
    </div>
"): SummaryComponent@18:26
'google-chart' is not a known element:
1. If 'google-chart' is an Angular component, then verify that it is part of this module.
2. If 'google-chart' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
        <div class="col-sm-12">
            <h2>Gaugh Chart</h2>
            [ERROR ->]<google-chart [data]="pieChartOptions"></google-chart>
        </div>
    </div>
"): SummaryComponent@18:12 ; Zone: <root> ; Task: Promise.then ; Value: 

Also, thanks for creating this awesome project. 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
souravmondal93commented, Mar 29, 2017

I made the charts working. I had to import it in barrel module instead of root module. Thanks @viwell and @gmazzamuto for your help. I am closing the issue.

0reactions
sunilbehera91commented, Jul 4, 2018

i have in the error that I am getting.the error , how to solve the error ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng2-google-charts - npm
Google Charts module for Angular 2 and beyond. ... Start using ng2-google-charts in your project by running `npm i ng2-google-charts`.
Read more >
Angular ng2 google chart not updating with new data
I'm working on a covid-19 tracking app using angular. My problem right now is making google chart update the moment new data is...
Read more >
Dates and Times | Charts - Google Developers
This is another reason why the use of datetime strings is not recommended. The below timeline breaks down an average day, using the...
Read more >
Chart Using ng2-google-charts - C# Corner
The next step is to import the Ng2GoogleChartsModule in your app.module.ts. This will allow you to use all of the features provided by...
Read more >
ng2-google-charts - npm Package Health Analysis - Snyk
The npm package ng2-google-charts was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found