|

|
Professional Computing Solutions, Inc.
|
|
|
Example -- StackedBarChart
A stacked bar chart allows you to specify values for individual categories and then
display those values in comparison to the total value of all categories combined. The
chart elements are displayed as horizontal bars. The example below shows the amount of sales
made by stores in individual regions as they contribute to the total company sales.
|
|
Go Back
|
The following code...
<!-- #include file="StackedBarChart.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
x(6, 0) = 1200
x(6, 1) = 1800
x(6, 2) = 600
x(7, 0) = 900
x(7, 1) = 3100
x(7, 2) = 2100
x(8, 0) = 2900
x(8, 1) = 2100
x(8, 2) = 1200
x(9, 0) = 2200
x(9, 1) = 1200
x(9, 2) = 1900
x(10, 0) = 2200
x(10, 1) = 2200
x(10, 2) = 2200
x(11, 0) = 1900
x(11, 1) = 1700
x(11, 2) = 700
y = Array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec")
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"
StackedBarChart x, y, z, optList
Creates this chart...
Sales by Region | Jan | | | | Feb | | | Mar | | | Apr | | | May | | | Jun | | | Jul | | | Aug | | | Sep | | | Oct | | | Nov | | | Dec | | | | | $770 | $1540 | $2310 | $3080 | $3850 | $4620 | $5390 | $6160 | $6930 | $7700 | | | |
Example -- StackedBarChartHREF
New in WebCharts Pro! Creates the same high-quality stacked bar chart, but
allows the series within the bars to be hyper linked to other web pages.
Each
individual series within each bar can
be linked to a separate page.
|
The following code...
<!-- #include file="StackedBarChart.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
x(6, 0) = 1200
x(6, 1) = 1800
x(6, 2) = 600
x(7, 0) = 900
x(7, 1) = 3100
x(7, 2) = 2100
x(8, 0) = 2900
x(8, 1) = 2100
x(8, 2) = 1200
x(9, 0) = 2200
x(9, 1) = 1200
x(9, 2) = 1900
x(10, 0) = 2200
x(10, 1) = 2200
x(10, 2) = 2200
x(11, 0) = 1900
x(11, 1) = 1700
x(11, 2) = 700
Dim hrefList2(11, 2)
hrefList2(0, 0) = "details.asp?MTH=0®=East"
hrefList2(0, 1) = "details.asp?MTH=0®=North"
hrefList2(0, 2) = "details.asp?MTH=0®=South"
hrefList2(1, 0) = "details.asp?MTH=1®=East"
hrefList2(1, 1) = "details.asp?MTH=1®=North"
hrefList2(1, 2) = "details.asp?MTH=1®=South"
hrefList2(2, 0) = "details.asp?MTH=2®=East"
hrefList2(2, 1) = "details.asp?MTH=2®=North"
hrefList2(2, 2) = "details.asp?MTH=2®=South"
hrefList2(3, 0) = "details.asp?MTH=3®=East"
hrefList2(3, 1) = "details.asp?MTH=3®=North"
hrefList2(3, 2) = "details.asp?MTH=3®=South"
hrefList2(4, 0) = "details.asp?MTH=4®=East"
hrefList2(4, 1) = "details.asp?MTH=4®=North"
hrefList2(4, 2) = "details.asp?MTH=4®=South"
hrefList2(5, 0) = "details.asp?MTH=5®=East"
hrefList2(5, 1) = "details.asp?MTH=5®=North"
hrefList2(5, 2) = "details.asp?MTH=5®=South"
hrefList2(6, 0) = "details.asp?MTH=6®=East"
hrefList2(6, 1) = "details.asp?MTH=6®=North"
hrefList2(6, 2) = "details.asp?MTH=6®=South"
hrefList2(7, 0) = "details.asp?MTH=7®=East"
hrefList2(7, 1) = "details.asp?MTH=7®=North"
hrefList2(7, 2) = "details.asp?MTH=7®=South"
hrefList2(8, 0) = "details.asp?MTH=8®=East"
hrefList2(8, 1) = "details.asp?MTH=8®=North"
hrefList2(8, 2) = "details.asp?MTH=8®=South"
hrefList2(9, 0) = "details.asp?MTH=9®=East"
hrefList2(9, 1) = "details.asp?MTH=9®=North"
hrefList2(9, 2) = "details.asp?MTH=9®=South"
hrefList2(10, 0) = "details.asp?MTH=10®=East"
hrefList2(10, 1) = "details.asp?MTH=10®=North"
hrefList2(10, 2) = "details.asp?MTH=10®=South"
hrefList2(11, 0) = "details.asp?MTH=11®=East"
hrefList2(11, 1) = "details.asp?MTH=11®=North"
hrefList2(11, 2) = "details.asp?MTH=11®=South"
y = Array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec")
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"StackedBarChartHREF x, y, z,
hrefList, optList
Creates this chart...
Sales by Region | Jan | | | | Feb | | | Mar | | | Apr | | | May | | | Jun | | | Jul | | | Aug | | | Sep | | | Oct | | | Nov | | | Dec | | | | | $770 | $1540 | $2310 | $3080 | $3850 | $4620 | $5390 | $6160 | $6930 | $7700 | | | |
Send comments or questions on this page to webmaster@thePCSweb.com
Copyright © 1999-2008 Professional Computing Solutions, Inc.
|