Hi, I've the problem with data array generated for query. The graphic include only first record, not all records. Why? This is the code in the my asp page: -
<%@ language="vbscript" %>
-
<!--#include file="../Connections/dicomp.asp" -->
-
<%
-
Dim oConn, oRs
-
set oConn= Server.CreateObject ("ADODB.Connection")
-
Set oRs= Server.CreateObject("ADODB.Recordset")
-
-
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("dicomp.mdb")
-
-
'oRs.open "Select conteggio,catgramm From sommacat order by catgramm asc", oConn
-
'oRs.open "SELECT Sum(Conteggio) AS SommaDiConteggio, catgramm FROM conteggiocat GROUP BY catgramm ORDER BY catgramm", oConn
-
oRs.open "SELECT catgramm,sum(conteggio) as sommaconteggio FROM conteggiocat GROUP BY catgramm ORDER BY catgramm", oConn
-
-
set cd = CreateObject("ChartDirector.API")
-
'------------------------------------------
-
if not oRs.EOF then
-
do while not oRs.EOF
-
data = data&","&oRs("sommaconteggio")
-
labels = labels &","& oRs("catgramm")
-
oRs.MoveNext
-
loop
-
end if
-
-
Arraydata = Split(right(data,len(data)-1), ",",-1,1)
-
Arraylabels = Split(right(labels,len(labels)-1), ",",-1,1)
-
-
for i = 0 to ubound(Arraydata)
-
data = Array(Arraydata(i))',Arraydata(1)',Arraydata(2),Arraydata(3),Arraydata(4))
-
next
-
-
for i = 0 to Ubound(Arraylabels)
-
labels = Array(Arraylabels(i))',Arraylabels(1),Arraylabels(2),Arraylabels(3),Arraylabels(4))
-
next
-
-
' Create a PieChart object of size 560 x 270 pixels, with a golden background and a 1
-
' pixel 3D border
-
Set c = cd.PieChart(560, 270, cd.goldColor(), -1, 1)
-
-
' Add a title box using 15 pts Times Bold Italic font and metallic pink background
-
' color
-
Call c.addTitle("Grafico delle Categorie Grammaticali", "timesbi.ttf", 15).setBackground( _
-
cd.metalColor(&Hff9999))
-
-
' Set the center of the pie at (280, 135) and the radius to 110 pixels
-
Call c.setPieSize(280, 135, 110)
-
-
' Draw the pie in 3D with 20 pixels 3D depth
-
Call c.set3D(20)
-
-
' Use the side label layout method
-
Call c.setLabelLayout(cd.SideLayout)
-
-
' Set the label box background color the same as the sector color, with glass effect,
-
' and with 5 pixels rounded corners
-
Set t = c.setLabelStyle()
-
Call t.setBackground(cd.SameAsMainColor, cd.Transparent, cd.glassEffect())
-
Call t.setRoundedCorners(5)
-
-
' Set the border color of the sector the same color as the fill color. Set the line
-
' color of the join line to black (0x0)
-
Call c.setLineColor(cd.SameAsMainColor, &H000000)
-
-
' Set the start angle to 135 degrees may improve layout when there are many small
-
' sectors at the end of the data array (that is, data sorted in descending order). It
-
' is because this makes the small sectors position near the horizontal axis, where
-
' the text label has the least tendency to overlap. For data sorted in ascending
-
' order, a start angle of 45 degrees can be used instead.
-
Call c.setStartAngle(135)
-
-
' Set the pie data and the pie labels
-
Call c.setData(data, labels)
-
-
' output the chart
-
Response.ContentType = "image/png"
-
Response.BinaryWrite c.makeChart2(cd.PNG)
-
Response.End
-
-
Set c = nothing
-
-
Set cd = nothing
-
%>
-
tks very very much
F
1 1509
The two "for...next" loops starting on lines 27 and 31 are looping and overwriting, rather than appending data.
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: MMMMM |
last post by:
Hmmm, my array seems to be emptying itself for no reason. I just want to grab every form element posted to the page into an
appropriately sized array... What is going on here?
dim arrShort()...
|
by: David Lozzi |
last post by:
Howdy,
I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders!
Now I am making a public function that will take the...
|
by: JoeC |
last post by:
I am trying to write a graphic library. Yes, I know that it is byoined
the scope of this group but I broke the file down to reading a text
file of numbers. The problem I am having is that the...
|
by: JoeC |
last post by:
I am still working in my maze game and I am making improvments. The
main sticking problem that I have is passing my graphic library. This
probram uses windows apis but my question has nothing to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |