Well, can you build your data string out prior to creating your image?

If you can store your data in some variable prior to adding it to the
image, you can just do some simple string manipulation to strip the
last comma off.

I.e:

WHILE NOT gamesdisplayyearly.EOF

strData &= gamesdisplayyearly("gamecount") & ","

gamesdisplayyearly.MoveNext()

strData = Mid(strData, 1, Len(strData) - 1)

then, just add strData to your img src?

Just a suggestion.

-N

On May 12, 6:06 am, ChrisPols <[email protected]> wrote:
> Hi,
>
> I couldn't think of a proper question to search for my problem.
>
> My graphs are working correctly to a point, but i'm unable to get my
> head around fixing a certain statement.
>
> Here's my code for google charts:
>
> <img src="http://chart.apis.google.com/chart?
> chs=350x250
> &amp;chd=t:0<%while NOT gamesdisplayyearly.EOF%>,<
> %=(gamesdisplayyearly("gamecount"))%><%gamesdisplayyearly.movenext()%><
> %wend%>
> &amp;chxl=2:|<%while NOT datedisplayyearly.EOF%>|<
> %=datedisplayyearly("months")%><%datedisplayyearly.movenext()%><%wend
> %>|1:||3:|
>
> My problem is the above bit of code. I'm running a while statement to
> go over the data, but Google charts needs a comma as a separator. The
> only workaround I managed is to start it with 0 and put in a comma
> directly after that, so that you don't get a comma at the end of the
> statement.
> The data should read: 768,447,338,2287   - I end up with
> 768,447,338,2287, (which causes google charts to break), so I do it
> this way (as above) 0,768,447,338,2287 and it works. But I don't want
> the 0 there.
> I bet this is an easy repeat concept  I just don't know it.
> Any ideas?
>
> Thanks a lot,
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Chart API" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/google-chart-api?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to