Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8389697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:47:52+00:00 2026-06-09T18:47:52+00:00

I am using the google chart framework based on a data in database… I

  • 0

I am using the google chart framework based on a data in database…

I need to generate an output like:

([
  ['Year',  'ON',   'OFF',  'X1',   'X2'],
  ['Jan/12',    2,  5,      10,         9],
  ['Fev/12',    5,  10,     54,         10],
  ['Mar/12',    10, 36,     15,         10]
]);

Note that the last line do not have a comma. My code looks like:

([
  ['Year',  'ON',   'OF',   'X1',   'X1'],
    <%
        WHILE NOT DB.EOF
        ON= DB("ON")
        OFF= DB("OFF")
        X1= DB("X1")
        X2= DB("X2")
    %>
        ['<% Response.Write Month %>/<% Response.Write Year %>',    <% Response.Write ON %>, <% Response.Write OFF %>, <% Response.Write X1 %>, <% Response.Write X2 %>,
    <%
        DB.MOVENEXT
        WEND
    %>
]);

My question: How can I check when the loop come to the last line, instead of put the comma, put just nothing?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:47:53+00:00Added an answer on June 9, 2026 at 6:47 pm

    AnthonyWJones’s answer seems ok for me, but you could also ask inside loop if after move next you’re not at EOF then you write “,”

    ([ 
        ['Year',  'ON',   'OFF',   'X1',   'X2']
        <% Do While Not DB.EOF %>
            [
             '<%= Month %>/<%= Year %>', 
             <%= DB("ON") %>, 
             <%= DB("OFF") %>, 
             <%= DB("X1") %>, 
             <%= DB("X2") %>
            ]
            <%
            DB.MoveNext
            %>
            <% If Not DB.EOF Then %>
                ,
            <% End If %>
        <% Loop %>
    ]); 
    

    😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am populating my Google chart using JSON currently, but I need to customize
I'm using the Google charts API to generate a pie chart in my Rails
I used Google chart api to generate the chart using webview in android. Now
I am using a Google Line Chart to graph values pulled from a database
I am using Google Chart QR code , I have to send data more
I'm using the Google chart on my website and I would like to pass
Im trying to using Google Area Chart and PHP to display some data. problem
I'm developing an application which draws some charts and I'm using Google Chart. After
I am currently using a google visualisation pie chart. The legends of the chart
I am trying to create a Google line chart using their API and JSON.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.