We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Google Chart API and VB.net

Medium Priority
Last Modified: 2013-11-26
I am attempting to use the Google Chart API to create a data driven bar chart.  Below is the example code but i would like to dynamically get the day values so that it displays the last 5 days so if today is Friday it would be as below but on Monday is would be (

The data i know i can get from my SQL query as i have done this previously with a pie chart but i cant seem to get the last five days in this way.

I have seen some controls for similar but they are all in C and i want it in VB.net if possible.

The other tact i have tried is to create variables in the vb.net file containing:
        Dim dtmyesterday As String
        dtmyesterday = Today.AddDays(-1).ToString("dd/MM/yyyy")

but how do i get this into the code above in asp.net?
<img src="http://chart.apis.google.com/chart?
alt="Sample chart" id="IMG1" onclick="return IMG1_onclick()" />

Open in new window

Watch Question


wow 5 hours have passed, dont tell me there isnt an expert out there who can help?

I have created a session variable in the VB which displays the date just as i want it now i need to workout a way to response.write that into the google api code for example:

<img src="http://chart.apis.google.com/chart?
&amp;chl=Mon|Tue|Wed|Thu|<% response.write(session(test)) %>|"
alt="Sample chart" id="IMG1" onclick="return IMG1_onclick()" />
Analyst Programmer
You should look at this "Google Chart API Custom Server Control "
it`t a way to create Charts with google charts easier with asp.net

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.