Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Changing chart title changes position of chart

Hello,

I've written some code to programmatically change the chart title and chart
title font size based on user interaction.

Problem is that each time the title undergoes a smaller font size change,
the chart actually changes position within the chart area by moving up.

Also any labels i've placed in the chart area also changes position and move
up as well.

Anyone have any ideas why and how to stop this?

Thank for helping!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Changing chart title changes position of chart

Good Morning Bing,

Problem is that each time the title undergoes a smaller

font size change,
the chart actually changes position within the chart area

by moving up.

Also any labels i've placed in the chart area also

changes position and move
up as well.

Anyone have any ideas why and how to stop this?


well, afaik this is because Excel automatically arranges
all elements within a chart so that every element has the
max size. So if e.g. the chart title becomes smaller,
excel makes the chartarea larger...

I think you could stop this by using the

AutoScaleFont Property

for each element within the chart... e.g.

Selection.AutoScaleFont = False

Best

Markus

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Changing chart title changes position of chart

Also, once you explicitly set the size/position of an object, Excel doesn't try to
autofit it within the chart. So:

With ActiveChart.PlotArea
' position and size parameters are in points
' choose parameters that suit your situation
'
' shrink plot area first so you can move unconstrained
.Width = 50
.Height = 50
' position and resize plot area
.Left = 10
.Top = 24
.Width = 250
.Height = 175
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Markus Scheible wrote:

Good Morning Bing,


Problem is that each time the title undergoes a smaller


font size change,

the chart actually changes position within the chart area


by moving up.

Also any labels i've placed in the chart area also


changes position and move

up as well.

Anyone have any ideas why and how to stop this?



well, afaik this is because Excel automatically arranges
all elements within a chart so that every element has the
max size. So if e.g. the chart title becomes smaller,
excel makes the chartarea larger...

I think you could stop this by using the

AutoScaleFont Property

for each element within the chart... e.g.

Selection.AutoScaleFont = False

Best

Markus


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Changing chart title changes position of chart

Hi Markus, Jon

Thanks for your help. It works!

Cheers,
Bing

"Jon Peltier" wrote:

Also, once you explicitly set the size/position of an object, Excel doesn't try to
autofit it within the chart. So:

With ActiveChart.PlotArea
' position and size parameters are in points
' choose parameters that suit your situation
'
' shrink plot area first so you can move unconstrained
.Width = 50
.Height = 50
' position and resize plot area
.Left = 10
.Top = 24
.Width = 250
.Height = 175
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Markus Scheible wrote:

Good Morning Bing,


Problem is that each time the title undergoes a smaller


font size change,

the chart actually changes position within the chart area


by moving up.

Also any labels i've placed in the chart area also


changes position and move

up as well.

Anyone have any ideas why and how to stop this?



well, afaik this is because Excel automatically arranges
all elements within a chart so that every element has the
max size. So if e.g. the chart title becomes smaller,
excel makes the chartarea larger...

I think you could stop this by using the

AutoScaleFont Property

for each element within the chart... e.g.

Selection.AutoScaleFont = False

Best

Markus



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing position of shapes in chart Matt S[_2_] Excel Discussion (Misc queries) 1 March 25th 10 01:14 PM
Office 07 Excel chart title position Eve Allen[_2_] Charts and Charting in Excel 1 January 21st 09 01:13 PM
Changing Right Position of Chart AdmiralAJ Charts and Charting in Excel 5 April 13th 07 09:29 PM
changing chart title via vba? basis Excel Programming 2 October 20th 03 08:07 PM
changing chart title via vba? basis[_2_] Excel Programming 0 October 20th 03 05:47 PM


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"