Comments (2)
Hi @simonmoreau
If you want to use the Formatter object of GoogleCharts, here's what you have to do (also found in the README.
In the component where you want to create the chart, inject the ScriptLoaderService
.
Example:
constructor(private loaderService: ScriptLoaderService) {}
Then subscribe to the onReady
event of the ScriptLoaderService
and load the package you need in the callback. As an example and to follow best practices, I'll do this in the onInit
method. It can, however, be done anywhere in your component:
ngOnInit() {
this.loaderService.onReady.subscribe(() => {
this.loaderService.loadChartPackages(this.type).subscribe(() => {
// Start creating your chart now
// Example:
const formatter = new google.visualization.BarFormat();
});
});
}
where this.type
is your chart type, and you can get it by calling the following line:
this.type = GoogleChartPackagesHelper.getPackageForChartName('BarChart');
Hope this helps. If you still have any problems regarding this issue, feel free to point them out.
from angular-google-charts.
I get it, it is working fine by now ! Thank you for your help !
from angular-google-charts.
Related Issues (20)
- Push latest version to npmjs.com HOT 2
- how to clear table in the latest api? HOT 1
- New version 2.2.3 is not compatible with the current stable version of Angular (v13.2.0) HOT 8
- Angular v8. Compilation fails when importing the module. Error states: 'Please add a @NgModule annotation'
- Unable to install angular-google-charts in project
- Angular google chart Version 2.2.2 Is not working on my existing Angular 9 Application HOT 1
- Use Types interfaces in project
- GoogleChartPackagesHelper.getPackageForChartName for angular 14
- The target entry-point "angular-google-charts" has missing dependencies: - @angular/core
- Update peerDependencies for Angular 15 HOT 4
- Locale Support HOT 1
- Expand Row interface definition HOT 1
- I don't get any error but I don't see anything
- Calendar Heatmap Type Not Work dynamicResize
- Angular 16 support HOT 8
- Customize tooltip
- broaden type Row in chart-base.component.ts HOT 1
- Memory leak
- This library is unmaintained HOT 2
- Angular 18 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-google-charts.