Comments (9)
I've just published a new version of the package that exports the ScriptLoaderService. You'd have to inject this service into your custom component and then wait for onLoad to be called. Just see the Google-Charts-Component as an example.
from angular-google-charts.
Sweet, thanks!
from angular-google-charts.
so, I see how you used the script loader service to get the chart packages, but what if I want to make a formatter? I still need the google.visualization object, right? Like in your formatter example:
myFormatter = [
{ formatter: new google.visualization.Dateformat({formatType: 'long'}), colIndex: 1 },
{ formatter: new google.visualization.Dateformat({formatType: 'long'}), colIndex: 3 }
];
from angular-google-charts.
Having a new issue after updating to 0.0.7. All of my module.ngfactory.js files are throwing this error:
"export 'Éľa' (imported as 'i39') was not found in 'angular-google-charts'
from angular-google-charts.
i downgraded to 0.0.6 and had the same errors. had to go back to 0.0.5 to get rid of them
from angular-google-charts.
Could you please provide explanation on how to reproduce this?
from angular-google-charts.
I tried to create a stackblitz to reproduce, but I can't seem to. It must be something specific to my project. I can add that when I try to render the chart, I get this error after every change detection:
TypeError: ctor is not a constructor
at _createClass (core.js:10628)
at createProviderInstance$1 (core.js:10602)
at resolveNgModuleDep (core.js:10553)
at NgModuleRef.get (core.js:11595)
at resolveDep (core.js:12074)
at createClass (core.js:11934)
at createDirectiveInstance (core.js:11777)
at createViewNodes (core.js:13239)
at createEmbeddedView (core.js:13116)
at callWithDebugContext (core.js:14524)
I'm not sure what's going on or why it is happening with the newer versions only
from angular-google-charts.
hm, I have been trying to create a stackblitz example that reproduces the errors I was seeing, but I just couldn't. I added all the modules my app imports and couldn't. So, I decided to try seeing if it was a package version issue with some other package, so I blew out my local node_modules and reinstalled everything and now the errors are gone from my project. Just one of those shruggie moments. Anyway, while building the stackblitz I also did an example of how to use the script loader service. Here is a snippet of how I used it to make a formatter that I think could help others:
constructor( private loaderService: ScriptLoaderService ) {}
ngOnInit() {
this.loaderService.onReady.subscribe( () => {
this.loaderService.loadChartPackages(this.type).subscribe( () => {
console.log('loaded chart packages');
const formatter = new google.visualization.BarFormat();
console.log(formatter);
});
});
}
It's worth noting that this.type needs to be the translated string that your package returns with [GoogleChartPackagesHelper.getPackageForChartName(this.type)]. That helper isn't available, so I had to look at it to figure out what string to actually pass. That helper being available would be nice.
Again, thanks for the quick turnaround on exposing the service
from angular-google-charts.
Thanks for the code example, I've added a new section to the readme based on it! đ
I'm also happy that everything worked out for you, I'll close this one now.
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.