? I do not see anything, what happened??

43 views
Skip to first unread message

Davide Gentile

unread,
Feb 10, 2012, 8:51:33 AM2/10/12
to Google Visualization API, google-visua...@googlegroups.com
Good day,
After creating all the code to create PieChart dynamics, the problem I
have is that I do not see anything on screen: as you can??
I look forward to your feedback, thanks ... David

HTML <script type = vbs />
VBS (<span> <script type = Chart.js /> </ span>)

asgallant

unread,
Feb 10, 2012, 9:49:20 AM2/10/12
to google-visua...@googlegroups.com
Can you provide your code or a link to the page?

Davide Gentile

unread,
Feb 10, 2012, 10:06:41 AM2/10/12
to Google Visualization API
I answer at your email address drew_gall...@abtassoc.com , ok?

asgallant

unread,
Feb 10, 2012, 10:18:13 AM2/10/12
to google-visua...@googlegroups.com
I would prefer to keep everything in these forums, unless this is something you can't share with the public.

Davide Gentile

unread,
Feb 10, 2012, 10:25:15 AM2/10/12
to Google Visualization API
because you understand, I have to send attachments..
David ..

asgallant

unread,
Feb 10, 2012, 11:02:56 AM2/10/12
to google-visua...@googlegroups.com
You can attach files to forum posts.

Davide Gentile

unread,
Feb 10, 2012, 11:06:43 AM2/10/12
to Google Visualization API
can you tell me how?
David

asgallant

unread,
Feb 10, 2012, 11:10:51 AM2/10/12
to google-visua...@googlegroups.com
When you create a post, there is a link above the text field that says 'Attach a file'

Davide Gentile

unread,
Feb 10, 2012, 11:23:31 AM2/10/12
to Google Visualization API
There is no "attach file", maybe because we are Italian :)
How do we do?
David

Davide Gentile

unread,
Feb 12, 2012, 11:56:15 AM2/12/12
to Google Visualization API
!! Help Me, Please..
David

NA

unread,
Feb 12, 2012, 8:21:03 PM2/12/12
to Google Visualization API
asgallant - I also don't see an "Attach a file" link either. Are you
posting to the list from the Groups web page, or from within another
app?

Davide, can you post your code snippet to jsfiddle instead? We might
be able to see it there.

Davide Gentile

unread,
Feb 13, 2012, 5:55:31 AM2/13/12
to Google Visualization API
NA <nabeel.a...@gmail.com>: in jsfiddle.net there VBS (vbscript), so
it is impossible to copy it!

Main HTML >> EXEC function VBscript
Function VBscript >> HTML
HTML >> EXEC Chart.js (javascript)
The problem is: EXEC Chart.js (javascript) By Function VBscript or
Main HTML

Davide

Davide Gentile

unread,
Feb 13, 2012, 8:01:21 AM2/13/12
to Google Visualization API
WEB_InterFace.html
<HTML>
<HEAD>
<title>Gestione Dati Sviluppo: Cruscotto</title>
<script type="text/javascript"
src='https://www.google.com/jsapi?autoload={modules:
[{name:"visualization",version:"1",packages:["corechart"]}]}'>
</script>
<script type="text/vbscript" src="WEB_InterFace.vbs"></script>
</HEAD>
<BODY bgcolor="#E6E6FA" link="blue" alink="blue" vlink="blue"
text="green" onload="Carica_HomePage()">
<div align="justify" id="Torte_HomePage" style="border: '1px solid
green'; z-index: '50'">
.... .... .... .... elaborazione in corso .... .... .... .... </div>
</BODY>
</HTML>

WEB_InterFace.vbs
Sub HomePage()
On Error Resume Next
StrDIV = ""
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &
NomeFileACCDB & ";Persist Security Info=False;"
CommandSQL = "EXEC " & SelectInfo
Set objRecordset = objConnection.Execute(CommandSQL)
objRecordset.MoveFirst
Do
If NR Mod VariabileGlobale = 0 Then
IT = IT + 1
Testa = Testa & "<SPAN ID=" & NomeTorta & IT & "' Z-INDEX: '" &
IT & "'>" & VbCrLf & _
"<script type='text/javascript'>" & VbCrLf & _
"<!--google.load('visualization', '1', {packages:[" & TipoTorta
& "]});-->" & VbCrLf & _
"google.setOnLoadCallback(draw" & VariabileChart & IT & ");" &
VbCrLf & _
"function draw" & VariabileChart & IT & "() {" & VbCrLf & _
"var " & VariabileTorta & IT & " = new
google.visualization.DataTable();" & VbCrLf
End If
For I = 0 To IC - 1
lettura access
Next
If NR Mod VariabileGlobale = VariabileGlobale - 1 Then
creazione chart nel StrDIV
End If
objRecordset.MoveNext
Loop Until objRecordset.EOF
objConnection.Close()
Set objConnection = Nothing
Set objRecordset = Nothing
Set wshShell = Nothing
Torte_HomePage.InnerHTML = StrDIV
'Torte_HomePage.InnerText = StrDIV
End Sub

but I see nothing in the html page, what happened?

asgallant

unread,
Feb 13, 2012, 10:35:07 AM2/13/12
to google-visua...@googlegroups.com
I post from here: https://groups.google.com/forum/#!forum/google-visualization-api

Can you post the JS rendered in a browser from that VB code?  

Davide Gentile

unread,
Feb 13, 2012, 11:14:18 AM2/13/12
to google-visua...@googlegroups.com
thanks :)
Now I could give you anything!
Also analyzed with calm .. no hurry ..
David
Cruscotto_GDS (2011-12-01 - 2012-02-07).zip
JS rendered in a browser from that VB code.txt

Davide Gentile

unread,
Feb 13, 2012, 11:17:02 AM2/13/12
to Google Visualization API
Then: the attached file has 9 rows, including the home page or main
page is the file WEB_InterFace.html, but before you run it you should
change the variable LetteraDisco_Cruscotto_GDS_WorkingPath entering
the path of the folder containing the file access (Cruscotto.accde) in
the file WEB_InterFace.vbs!!
Thank you for your interest.. ..
David

Davide Gentile

unread,
Feb 14, 2012, 11:14:00 AM2/14/12
to Google Visualization API
Big problem, right? ..
David

NA

unread,
Feb 14, 2012, 11:30:50 AM2/14/12
to Google Visualization API
Hi Davide,

I'm sorry, but I'm not able to look through so much code to figure out
what the problem is. Can you perhaps come up with a smaller version
that reproduces the problem?

Also, if you run a debugger like Firebug, what does it say? Sometimes
you won't see anything because an error occurred, but there will be no
indication of the error when viewing the web page. You'd need to view
Firebug's console to see what happened.

Firebug is an add-on you can include with Chrome or Firefox. If
you're using IE, I think that just pressing F12 should bring up the
debugger.



asgallant

unread,
Feb 14, 2012, 11:39:52 AM2/14/12
to google-visua...@googlegroups.com
I finally got around to taking a look at your code, and there are a number of issues that you need to fix:

1) each chart needs to draw in a <div>, not a <span>.
2) the javascript must be placed outside the chart's div (preferably in the head, though this is not strictly necessary) - the contents of the chart div's are overwritten by the API, so any <script> tags inside would be lost.
3) you only need to call google.load() once
4) you need to create one initialization function (that calls the drawing functions) and call it from google.setOnLoadCallback()
5) the 'onmouseover' and 'onmouseout' event handlers won't work, as the #addListener method only works for API-specific events.  You will need to create generic event handlers for those (either on the chart's container div or the body of the chart's iframe's contents, depending on what you are doing with the event handlers)

The output might look something like this when you are done:

<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script> 
<script type="text/javascript"> 
    google.load('visualization''1'{packages['corechart']});
    google.setOnLoadCallback(init);
    
    function init ({
        drawChart1();
        drawChart2();
        drawChart3();
        drawChart4();
        drawChart5();
        .
        .
        .
        drawChartN();
    }
    
    function drawChart1 ({
        // chart drawing code
    }
    
    function drawChart2 ({
        // chart drawing code
    }
    
    function drawChart3 ({
        // chart drawing code
    }
    
    function drawChart4 ({
        // chart drawing code
    }
    
    function drawChart5 ({
        // chart drawing code
    }
    .
    .
    .
    function drawChartN ({
        // chart drawing code
    }
</script>
</head>
<body>
    <div id="PieChart_1"></div>
    <div id="PieChart_2"></div>
    <div id="PieChart_3"></div>
    <div id="PieChart_4"></div>
    <div id="PieChart_5"></div>
    .
    .
    .
    <div id="PieChart_N"></div>
</body> 

Davide Gentile

unread,
Feb 15, 2012, 3:37:55 AM2/15/12
to Google Visualization API
How do you write in the head?
David

asgallant

unread,
Feb 15, 2012, 9:19:07 AM2/15/12
to google-visua...@googlegroups.com
Presumably, you would do it in the same way as writing to the <body>.  Are you using a CMS or other system that doesn't give you access to the <head> of the page?  If so, then you can embed the script tags in the <body>, it's just not considered good practice to do so.

Davide Gentile

unread,
Feb 15, 2012, 10:20:05 AM2/15/12
to Google Visualization API
I see, thanks ..
Sorry for my insistence, but maybe it's better if you look at the
attached code with calm!
David

asgallant

unread,
Feb 15, 2012, 10:33:27 AM2/15/12
to google-visua...@googlegroups.com
I forgot you were working with VBS. I'm sorry, but I don't know how that works in conjunction with HTML.  You may have better luck asking in a VBS forum.

Davide Gentile

unread,
Feb 15, 2012, 10:40:48 AM2/15/12
to Google Visualization API
By Ok, thank you anyway ..
David
Reply all
Reply to author
Forward
0 new messages