Thread: Charts
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Phil Stanton[_2_] Phil Stanton[_2_] is offline
external usenet poster
 
Posts: 23
Default Charts

Thanks for coming pack, Peter

My definitions are

Dim Cht As Chart
Dim DtaSheet As DataSheet

I am struggling to differentiate between a DataSheet and a DataTable so
could be wrong here. Where is the data that "drives" the chart held
(remembering I am using Access not Excel, so there is no Worksheet.

Equally I am not sure of the difference between ChtLabel.Caption &
ChtLabel.Text

Unfortunately there is no Access equivalent of ScreenUpdating, but I have
tried making the chart invisible while the process is going on, but that
doesn't change the time taken.

I am surprised that as the process is so slow, I do not see the labels
appearing over the 20 seconds or so that it takes.

Have speeded things up a bit by deleting the DataLabels before running the
piece of code below

Phil

"Peter T" <peter_t@discussions wrote in message
...
It does seem too long, not sure if the time is getting the data from cells
or writing to the data labels. Normally it would be the latter but I don't
quite follow this Sheet reference
Cht.Application.DataSheet

It might help a little to temporarily disable screenupdating of the Excel
application.

Would it be viable for you to link the data labels directly to cells. Do
it
once then forget about them.

Regards,
Peter T


"Phil Stanton" wrote in message
...
I appreciate that this is an Excel forum, and I am using a chart object
in
Access, but probably I will be better off posting it to this newsgroup.

I am using a scatter chart on a form to show a map and points of interest
that I want labelled.

After a struggle I have loaded the map, loaded the point and from a
recordset, copied and pasted the label information into column 3 of the
chart's Datasheet.

Set DtaSheet = Cht.Application.DataSheet
For Each ChtLabel In ChtLabels
ChtLabel.Caption = DtaSheet.Cells(lCount + 2, 3)
lCount = lCount + 1
Next ChtLabel

This works OK but takes 20 seconds to label 68 points. I thought it might

be
quicker to do it this way rather than getting the label information

straight
from the recordset, but there is little difference in time.

What can I do to speed it up? Is there a way of loading all the labels at
once

Thanks

Phil