Hi JPC,

I'm under the impression that JavaScript execution is either severely
limited or disabled in most (if not all) email clients. So a live Google
Chart is out of the question. One thing that you could do is to save an
image of your desired chart via getImageURI
<https://developers.google.com/chart/interactive/docs/printing>, however
this will require you to first render your chart in a browser, capture the
image data URL and embed that image in your email. Another alternative
would be to use our deprecated image charts
<https://developers.google.com/chart/image/>, which work by constructing a
URL to a server that serves an image back.

On Tue, Mar 8, 2016 at 11:50 PM JPC <[email protected]> wrote:

> *I am trying to take server side acquired data, wrapped in HTML, PHP code,
> Javascript or whatever, to build code then sent via mail so the the
> recipient's browser shows him a graphic, *
>
> I've tried to use Google Charts Quickstart code (
> https://developers.google.com/chart/interactive/docs/quick_start)
>
> I've tried for three days to get it to work in a PHP email executed from
> the BASH shell, e.g. *php t5.php*
> I am able to successfully send basic HML in the mail php template code
> below.
>
> I took the quick-start code (above) and put it in the PHP email template
> (below) , being careful to change the proper double quotes (") to single
> quotes ('). See attached code (t5.php).
>
> *<?php*
>
> * $to .= '[email protected] <[email protected]>';*
>
>
> * $subject = 'Google Chart';*
>
> *$message = "*
> *<html>*
> *.*
> *.see attached file with Google quick-start source*
> *.*
> *</html>*
> *";*
>
>
> *$headers = 'MIME-Version: 1.0' . "\r\n";*
> *$headers .= 'Content-type:text/html;charset=UTF-8' . "\r\n";*
>
> *mail($to,$subject,$message,$headers);*
> *?>*
>
> So, I'm wondering if I have an improper Header or if Javascript is an
> issue or if I've done something stupid with quotes.
>
> I've searched Google, several forums, Github, etc. for to find a simple
> working example of a Google Chart embedded in an email using a process that
> can be automated. No joy.
> Perhaps this cannot be done via mail and can only be done from a website?
>
> It has been suggested that I take screenshots and send the .png or .jpg to
> my target recipient - not a process that can be automated.
>
>
>    1. *If for some reason this can't be done, I'd like to know.*
>    2. *If it can be done, I'd love to see an example. *
>    3. *If there is a better way to send data, wrapped in HTML, PHP code,
>    Javascript or whatever, to build code then sent via mail so the the
>    recipient's browser shows him a graphic, I would love to know what it is. *
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> https://groups.google.com/group/google-visualization-api.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/4512d9e6-f730-4122-9a5c-b0dbffe4a780%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/4512d9e6-f730-4122-9a5c-b0dbffe4a780%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

*[image: unnamed.gif]• Sergey Grabkovsky• Software Engineer• Google, Inc•
[email protected] <[email protected]>*

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAEwwup7Oo9oHFmyaQ5BWd415UUShVTKNNY1DJZKM8xUPW9h74w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to