• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2391
  • Last Modified:

Google Chart API and VB.net

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

0
sadshead
Asked:
sadshead
1 Solution
 
sadsheadAuthor 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()" />
0
 
David RobitailleAnalyst ProgrammerCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now