Legend moves across chart

  • Thread starter Thread starter Sinus Log
  • Start date Start date
S

Sinus Log

I have a line chart. When I change some specific values, a
macro is executed automatically. It changes the minimum and
maximum values on the horizontal axis, and also the number
format:
..MinimumScale=...
..MaximumScale=...
..TickLabels.NumberFormat=...

But then, the rectangle containing the legends moves. A few
pixels up, or to the left. Every time.

In the Format Legent screen, Placement tab, "Right" is
marked, and stays marked.

I suppose the macro is responsible, but I am not sure. How
do I fix that ?
 
Sinus said:
I have a line chart. When I change some specific values, a macro is
executed automatically. It changes the minimum and maximum values on the
horizontal axis, and also the number format:
.MinimumScale=...
.MaximumScale=...
.TickLabels.NumberFormat=...

But then, the rectangle containing the legends moves. A few pixels up,
or to the left. Every time.

In the Format Legent screen, Placement tab, "Right" is marked, and stays
marked.

I suppose the macro is responsible, but I am not sure. How do I fix that ?


Small error I made in my first post: it's an XY (Scatter) chart.
 
Hi,

I could not reproduce the problem from your description, although I have
seen it in the past.

Why not read the top and left properties of the legend at the beginning
of your macro and set them at the end if they have changed.

Cheers
Andy
 
Hi,

Can you email me the file, do not attached to this newsgroup.

I haven't seen this when the numbers in cells where modified and as I
said I can not get you code to re create the problem.

Cheers
Andy
 
Andy said:
Hi,

I could not reproduce the problem from your description, although I have
seen it in the past.

Why not read the top and left properties of the legend at the beginning
of your macro and set them at the end if they have changed.

Cheers
Andy

How do I do that ? It took me a couple of hours to figure
out how to program the number format. Could you tell me how
to modify my code, please ?
With graphique.Chart.Axes(xlCategory)
.MinimumScale = premPointComp
.MaximumScale = dernPointComp
.TickLabels.NumberFormat = formatNombres
End With

Thanks for your reply

PS: More on the symptoms
There's no problem until the macro is executed. The problem
shows afterwards when I modify a cell, even if that doesn't
trigger the macro.
 
Andy said:
Hi,

Can you email me the file, do not attached to this newsgroup.

I haven't seen this when the numbers in cells where modified and as I
said I can not get you code to re create the problem.

Cheers
Andy

Thanks, Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top