changkejun / google-chart-offline

google chart offline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use google chart offline in nodejs & handlebars

kandirajav opened this issue · comments

Thanks for the immediate response. Now I have one more issue.
Unable to use this in nodejs.

I kept charts/loader.js in public folder
and also kept charts folder (with OfflineSaving) inside public folder

This code below is the script I used in handlebars but I can't access the code in my handlebars progam. Feeling bad to not able to use and coming this close. Please provide a solution.

<script type="text/javascript" src="/charts/loader.js"></script>

"./charts/loader.js" is correct.
"/charts/loader.js" means http://yourDomain/charts/loader.js
"./charts/loader.js" means http://yourDomain/yourApp/charts/loader.js

And may I have the honor to receive your star click ? :)

Thanks for the reply. But the solution you provided didn't work for me. The above solution works good with normal html files but not with Node.js handlebars. where we use the format

<script type="text/javascript" src="./charts/loader.js"></script>

We keep the loader.js and the supportive files inside the folder "public/charts"
public is the root folder for static files in node.js express pgms. I called other files and they work fine for me. Example: works
but

<script type="text/javascript" src="./charts/loader.js"></script> <script type="text/javascript" src="/charts/loader.js"></script> <script type="text/javascript" src="charts/loader.js"></script>

all the above didn't work. please provide solution to use the files in a nodejs express program with handlebars.

Thank you for star click. :)

The google chart contents are static files. If it can be send to browser, it will work.
I dont think node.js eventment is treated specially.

I think you can call a image file from browser by url like "http://yourDomain/yourApp/folder1/test.jpg".
with the file path "public/folder1/test.jpg".

Be sure you can call the loader.js or any other js from browser by url.
2.
To check the console of browser maybe helpful to find what it wrong.
3.
Can you copy your page source here?