Search Tools Links Login

ASP bar chart


This code is an example how to use a random color generator and a table to create a Bar Chart.

Original Author: Noah Gates

Inputs

Numeric values to graph

Assumptions

The code is an example only. The user will need to adjust it to display the data which they wish to graph.

Code

'-------------------------------------------------------------------------------
' This is a sample of how to create your own bar chart using ASP
'-------------------------------------------------------------------------------

<%@ LANGUAGE="VBSCRIPT" %>




Document Title







<%
Dim totals(30)
Dim Names(30)
StatIndex = -1
%>
  


<%
On Error Resume Next
Randomize
'-------------------------------------------------------------------------------
' Purpose: To generate random colors
'-------------------------
Function rndcolor()
DIM LightDarkRange
LightDarkRange = 150
forered = Int(Rnd * LightDarkRange)
foregreen = Int(Rnd * LightDarkRange)
foreblue = Int(Rnd * LightDarkRange)
color = "#" & cstr(Hex(RGB(forered, foregreen, foreblue)))
rndcolor=color
End Function
%>






    

Inbound Calls






<%
for I = 0 to 20
vol = int(chartinfo(I))
label = int(chartinfo(I))


next
%>


<%
for i = 0 to StatIndex
%>
<%if totals(i) > 0 then%>





<% response.write label %>



<%response.write names(i)%>

<%end if%>
<%next%>





ngates@partnershealth.com

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 98 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.