473,473 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

auto chart update causes performance problem

Hi guys,

I have a problem when generating a chart from the objGraph.Application.
DataSheet using MSChart8(s. code):
The graph ist updated and therefore drawn everytime I update the DataSheet.
Since there isa lot of data
inserted into the DataSheet, this causes performance issues.

Any ideas ?
thx and best regards,

wwwpete

Dim RS As DAO.Recordset

Dim DateString, StartDate, SQL, UserName As String
Dim Feld() As Double 'enthält die Quantilsdaten
Dim UQuantile, EQuantile As Double
Dim i, j, tmp, NumberOfData As Long

Dim myGraph As Object
Dim objDS As Object

'Greife auf Datenblatt
Set objDS = ObjGraph.Application.DataSheet

objDS.Cells.Clear

'Spaltentitel setzen
objDS.Cells(1, 1) = "Quantile"
objDS.Cells(1, 2) = "Q2"
objDS.Cells(1, 3) = "UQuantile"
SQL = "SELECT * FROM ...;"
Set RS = CurrentDb().OpenRecordset(SQL, dbOpenSnapshot)

i = 0

Do While Not RS.EOF
ReDim Preserve Feld(i)
Feld(i) = RS("Quantile")
RS.MoveNext
i = i + 1
Loop
'Bestimme die Stichprobengrösse
NumberOfData = i
tmp = 0

For i = 0 To NumberOfData - 1
'Wahrscheinlichkeit bei U(0,1) ZV
UQuantile = (i + 1) / NumberOfData
'Bestimme die Anzahl der Quantile in der Stichprobe, die kleiner
als UQuantile sind.
If tmp -1 Then
j = tmp
Else
j = 0
End If
Do While (j < NumberOfData)
If Feld(j) UQuantile Then
Exit Do
End If
j = j + 1
Loop
tmp = j - 1
'empiriche Wahrscheinlichkeit aus Stichprobe
EQuantile = j / NumberOfData

'Schreibe Datensatz in Tabelle
objDS.Cells(i + 2, 1) = Feld(i)
objDS.Cells(i + 2, 2) = UQuantile
objDS.Cells(i + 2, 3) = Feld(i)
Next i
End If
'Schreibe Punkte (0,0) und (1,1) in Tabelle (für besser Darstellung).
objDS.Cells(NumberOfData + 2, 1) = 1
objDS.Cells(NumberOfData + 2, 3) = 1
objDS.Cells(NumberOfData + 3, 1) = 0
objDS.Cells(NumberOfData + 3, 3) = 0
Set objDS = Nothing
DoEvents
ObjGraph.Application.PlotBy = xlRows
ObjGraph.Application.PlotBy = xlColumns
ObjGraph.Refresh
Set ObjGraph = Nothing

Sep 7 '06 #1
0 1414

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: takilroy | last post by:
Hi, Does anyone know of a simple way to do this? I want to create an insert trigger for a table and if the record already exists based on some criteria, I want to update the table with the...
1
by: Jim | last post by:
I have this chart on a form. I'm trying to get this chart to render only if the user chooses to do so. This because of that the chart is quite complex and takes some time to render. I know that I...
22
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
13
by: Matik | last post by:
Hello everybody, First: SQL Server 2000 sp3a, HP cluster server, MS 2003 server, database recovery model simple Torn page detection: When I have this option turned on, processes conected with...
15
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
0
by: JohnnyB | last post by:
I've been wrestling with this off and on for a few days and came close but it's still not right. I'll try to explain it as best I can. I created a report with a pie chart on the first page that...
14
by: Wayne | last post by:
I posted about this problem over 12 months ago and even after Vista SP1 the problem still exists when running an Access database (A2003 and A2007 tested) under Vista. A workaround was suggested by...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
tracyyun
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...
0
agi2029
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.