Professional Computing Solutions, Inc.
Example -- ClusteredBarChart
ClusteredBarChart creates a chart using horizontal bars broken out into a series of values that lets multiple data points be charted by placing bars on top of each other. It displays information similar to a StackedBarChart, but the bars are on top of each other rather than next to each other. It will support an unlimited number of bar groups. To use this chart, you must include the file ClusteredBarChart.asp in your ASP page.
Go Back

The following code...

<!-- #include file="ClusteredBarChart.asp" -->
<%
Dim x(11, 2)
Dim optList
x(0, 0) = 2200
x(0, 1) = 1500
x(0, 2) = 4000

x(1, 0) = 1700
x(1, 1) = 2200
x(1, 2) = 1100

x(2, 0) = 3000
x(2, 1) = 1200
x(2, 2) = 700

x(3, 0) = 1300
x(3, 1) = 2400
x(3, 2) = 1700

x(4, 0) = 2300
x(4, 1) = 2100
x(4, 2) = 300

x(5, 0) = 3400
x(5, 1) = 400
x(5, 2) = 900

y = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun")
z = Array("East", "South", "West")
optList = "BgColor:008080;Legend:Y;Show:V;Dir:F;FormatValue:$;LabelFontFace:Arial;" & _
          "BarFontFace:Tahoma;LabelFontSize:2;RegKey:111-XXX-222;" & _ 
          "Caption:Sales by Region;PlotColor:0000FF;LabelColor:FFFF00"

ClusteredBarChart x, y, z, optList

Creates this chart...
Sales by Region
Jan  
$2200
$1500
$4000
Legend
    South
    North
    East
Feb  
$1700
$2200
$1100
Mar  
$3000
$1200
$700
Apr  
$1300
$2400
$1700
May  
$2300
$2100
$300
Jun  
$3400
$400
$900
 
$400 $800 $1200 $1600 $2000 $2400 $2800 $3200 $3600 $4000
 

Example -- ClusteredBarChartHREF
New in WebCharts Pro!  Creates the same high-quality clustered bar chart, but allows the bars to be hyper linked to other web pages.  Each bar can be linked to a separate page.

The following code...

<!-- #include file="ClusteredBarChart.asp" -->
<%
Dim x(11, 2)

x(0, 0) = 2200
x(0, 1) = 1500
x(0, 2) = 4000

x(1, 0) = 1700
x(1, 1) = 2200
x(1, 2) = 1100

x(2, 0) = 3000
x(2, 1) = 1200
x(2, 2) = 700

x(3, 0) = 1300
x(3, 1) = 2400
x(3, 2) = 1700

x(4, 0) = 2300
x(4, 1) = 2100
x(4, 2) = 300

x(5, 0) = 3400
x(5, 1) = 400
x(5, 2) = 900

Dim hrefList2(11, 2)
hrefList2(0, 0) = "details.asp?MTH=0&REG=East"
hrefList2(0, 1) = "details.asp?MTH=0&REG=North"
hrefList2(0, 2) = "details.asp?MTH=0&REG=South"

hrefList2(1, 0) = "details.asp?MTH=1&REG=East"
hrefList2(1, 1) = "details.asp?MTH=1&REG=North"
hrefList2(1, 2) = "details.asp?MTH=1&REG=South"

hrefList2(2, 0) = "details.asp?MTH=2&REG=East"
hrefList2(2, 1) = "details.asp?MTH=2&REG=North"
hrefList2(2, 2) = "details.asp?MTH=2&REG=South"

hrefList2(3, 0) = "details.asp?MTH=3&REG=East"
hrefList2(3, 1) = "details.asp?MTH=3&REG=North"
hrefList2(3, 2) = "details.asp?MTH=3&REG=South"

hrefList2(4, 0) = "details.asp?MTH=4&REG=East"
hrefList2(4, 1) = "details.asp?MTH=4&REG=North"
hrefList2(4, 2) = "details.asp?MTH=4&REG=South"

hrefList2(5, 0) = "details.asp?MTH=5&REG=East"
hrefList2(5, 1) = "details.asp?MTH=5&REG=North"
hrefList2(5, 2) = "details.asp?MTH=5&REG=South"

y = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun")
z = Array("East", "South", "West")
optList = "BgColor:008080;Legend:Y;Show:V;Dir:F;FormatValue:$;LabelFontFace:Arial;" & _
          "BarFontFace:Tahoma;LabelFontSize:2;RegKey:111-XXX-222;" & _ 
          "Caption:Sales by Region;PlotColor:0000FF;LabelColor:FFFF00"

ClusteredBarChartHREF x, y, z, hrefList, optList

Creates this chart...
Sales by Region
Jan  
$2200
$1500
$4000
Legend
    South
    North
    East
Feb  
$1700
$2200
$1100
Mar  
$3000
$1200
$700
Apr  
$1300
$2400
$1700
May  
$2300
$2100
$300
Jun  
$3400
$400
$900
 
$400 $800 $1200 $1600 $2000 $2400 $2800 $3200 $3600 $4000
 


Send comments or questions on this page to webmaster@thePCSweb.com
Copyright © 1999-2008 Professional Computing Solutions, Inc.