+ Start a Discussion
Pintu FrancisPintu Francis 

Google Visualization Charts in Lightning Component

Has anybody tried out integrating Google Charts to Lightning Components?

I am getting the following error while doing direct way of loading the jsapi in static resource and loading other packages in the google way(loading throught script as in the default google example).
User-added image

Also tried loading all the the resources referenced in script one by one to static resource and added using ltng:require, still did no good.

Please help if somebody has done it.
bob_buzzardbob_buzzard
I have tried it and hit the same issue that you did. The problem is that the google JavaScript wants to communicate with google, and the security policy won't allow it. There's no workaround as far as I know, I used D3.js instead.
Raju SandipamRaju Sandipam
bob: Could you please share a samle chart using D3.js in salesforce lightning?
Radhika BansalRadhika Bansal
Does anyone got any solution on how to implement google visualization with lightning component. I need it urgently.
Pintu FrancisPintu Francis
Do not use Google Visualization in lightning components. Even though we got it working it was rejected in Security Review as a part of security enforcement. Visualization plugin violates CSP, it does uncontrolled DOM modifications and has external references from script. These are not allowed from lightning components.

I would suggest to use HighCharts instead. 
Radhika BansalRadhika Bansal
Thanks Pintu, if you could provide a sample code of HighCharts then it would be very helpful.