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

x

Google Chart API and VB.net

Medium Priority
2,616 Views
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 (
&chl=Tue|Wed|Thu|Fri|Sat|Sun|Mon|")

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?
chs=500x200
&amp;chd=t:60,40,30,10,10
&amp;cht=bvg
&amp;chco=FF0000
&amp;chl=Mon|Tue|Wed|Thu|Fri|" 
alt="Sample chart" id="IMG1" onclick="return IMG1_onclick()" />

Open in new window

Comment
Watch Question

Author

Commented:
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?
chs=500x200
&amp;chd=t:60,40,30,10,10
&amp;cht=bvg
&amp;chco=FF0000
&amp;chl=Mon|Tue|Wed|Thu|<% response.write(session(test)) %>|"
alt="Sample chart" id="IMG1" onclick="return IMG1_onclick()" />
Analyst Programmer
Commented:
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
 
http://aspnet.4guysfromrolla.com/articles/112608-1.aspx

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.

OR

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.