function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arjun mohanarjun mohan 

Google Charts in lightning Components

Hi All,

Is there a way to intigrate Googlee Charts in My lightning Components.
If So can any one share some sample examples.

Thanks
Arjun.M
Best Answer chosen by arjun mohan
NagendraNagendra (Salesforce Developers) 
Hi Arjun,

Integrating google charts in lightning components is not possible as of now.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, You can use D3.js instead.

Note: Do not use Google Visualization in lightning components. Even though if you got it work it gets rejected in Security Review as a part of security enforcement. Visualization plugin violates CSP, it does uncontrolled DOM modifications and has external references from the script. These are not allowed from lightning components.

Please mark this as solved if the information helps.

Best Regards,
Nagendra.

 

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Arjun,

Integrating google charts in lightning components is not possible as of now.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, You can use D3.js instead.

Note: Do not use Google Visualization in lightning components. Even though if you got it work it gets rejected in Security Review as a part of security enforcement. Visualization plugin violates CSP, it does uncontrolled DOM modifications and has external references from the script. These are not allowed from lightning components.

Please mark this as solved if the information helps.

Best Regards,
Nagendra.

 
This was selected as the best answer
Leo10Leo10
Hi Nagendra,

Still, we are not able to use google charts in lightning components?. Is there any workaround like download and save as a static resource etc.

Regards,