Imprecise positioning of chart datalabels?

user-hostile

Registered User.
Local time
Today, 03:09
Joined
Oct 20, 2007
Messages
10
Hi. I'm working with some Access (MS Graph) pie charts on a report. The charts display their data correctly, and so the rowsources are set correctly. However, I'm trying to customize the positioning of the pie slices' datalabels. Here's what I'm trying to do, but it's not quite working:


Code:
for x = 1 to 4
   chart.seriescollection(1).datalabels.Left = chart.legendentries(x).Left + chart.legendentries(x).width

   chart.seriescollection(1).datalabels.Top = chart.legendentries(x).Top

next x
The problem is, on my second line within the loop (setting the Top property), Access can't seem to set the DataLabel.Top value to _exactly_ the same value as the LegendEntries.Top value?!

Sometimes it does: it may set the DataLabel.Top to 71, where the LegendEntries(x).Top is also 71.

But most of the time, it refuses to set DataLabel.Top to _exactly_ the value passed by LegendEntries(x).Top. Example:

LegendEntries.Top = 120
If I try to set DataLabel.Top to LegendEntries(x).Top, it will set DataLabel.Top to, maybe, 122. Access refuses to set that value to the _exact_ value passed. :confused:

Is there some invisible grid associated with the Chart object that is preventing me from setting the positioning this precisely? Any other ideas on how to "force" Access to position a datalabel _exactly_ where my code specifies?

Thanks in advance.


U-H
 

Users who are viewing this thread

Back
Top Bottom