LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
xppuser
 
Posts: n/a
Default how to center a square plot area in a square chart

hi all,

i have recorded a macro to produce a square chart containing a square plot.
i wish if it's at all possible to have the square plot centered within the
chart. is there a way to do this? below is the macro routine that i have
recorded in case there is a sub that can be inserted into the macros to
center the plot area within the chart area.

thank you,
jes


Sub squareGraph()
'
' squareGraph Macro
'

'
On Error GoTo notice

ActiveChart.ApplyCustomType ChartType:=xlUserDefined,
TypeName:="MyScatter"
ActiveChart.Parent.Width = 350
ActiveChart.Parent.Height = 350
ActiveChart.PlotArea.Select
Selection.Width = 250
Selection.Height = 250
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlValue).AxisTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlCategory).Select
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlCategory).AxisTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
Exit Sub
notice: MsgBox ("You didn't pick a chart first")

End Sub
 
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
is it possible two different colours in a chart plot area ? nasrev Charts and Charting in Excel 4 October 22nd 05 05:07 PM
excel should make it easier to have a 1 to 1 plot area in chart Andy Charts and Charting in Excel 2 September 2nd 05 03:42 AM
Resize chart area without resizing plot area Janwillem van Dijk Charts and Charting in Excel 2 August 2nd 05 01:52 AM
How do I alter plot area colour in a chart without a mouse? debbiecatal Charts and Charting in Excel 2 May 30th 05 04:11 AM
Setting custom chart causes plot area to collapse Chiara Charts and Charting in Excel 0 January 20th 05 05:32 PM


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

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

About Us

"It's about Microsoft Excel"