Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default Square Charts in Excel 2007

Has the new improved version of Excel got a function for producing square
grapsh (i.e. so the distance between units on the X and Y axes are equal)? If
not, why not? Seriously though, any suggestions are welcome.

Simon
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 99
Default Square Charts in Excel 2007

Hi Simon,

Has the new improved version of Excel got a function for producing square
grapsh (i.e. so the distance between units on the X and Y axes are equal)?
If
not, why not? Seriously though, any suggestions are welcome.

Simon


You need to use a scatter chart and change the axes to the same scale.

You can do this manually, or with a macro....

================================================== =========

Option Explicit

Sub SquareChart()
Dim success As Boolean
Dim oCht As ChartObject

' oCht is the first chart object in the active sheet
' change this to ...ChartObjects("myChart") to use this
' on another chart
Set oCht = ActiveSheet.ChartObjects(1)

' if this is not a scatter chart, tell the user and exit
Select Case oCht.Chart.Type
Case xlXYScatter, xlXYScatterLines, xlXYScatterLinesNoMarkers,
xlXYScatterSmooth, xlXYScatterSmoothNoMarkers
success = SquareScatter(oCht)
Case Else
MsgBox "You need to change the chart type to Scatter"
Exit Sub
End Select

' give helpful message to user if code fails
If Not success Then
MsgBox "The code was willing," & Chr(10) & _
"It considered your request," & Chr(10) & _
"But the chips were weak."
End If

End Sub

Function SquareScatter(oCht As ChartObject) As Boolean
Dim cht As Chart
Dim lngType As Long
Dim oPltArea As PlotArea
Dim oAxisY As Axis
Dim oAxisX As Axis
Dim lngAxisMin As Long
Dim lngAxisMax As Long

' error handling
On Error GoTo fnError
SquareScatter = False

' oCht is a chart object passed to the function
' cht is the chart contained in this chart object
Set cht = oCht.Chart

' set the chart object size
' these values look good to me
' feel free to change
oCht.Height = 250
oCht.Width = 350

' set plot area to be square
Set oPltArea = cht.PlotArea

oPltArea.Height = 220
oPltArea.Width = 220

' get minimum and maximum scale from
' both axes
Set oAxisX = cht.Axes(xlCategory)
Set oAxisY = cht.Axes(xlValue)
lngAxisMin = Application.WorksheetFunction.Min(oAxisX.MinimumSc ale,
oAxisY.MinimumScale)
lngAxisMax = Application.WorksheetFunction.Max(oAxisX.MaximumSc ale,
oAxisY.MaximumScale)

' set both axes to the same scale
oAxisX.MajorUnitIsAuto = False
oAxisX.MinimumScale = lngAxisMin
oAxisX.MaximumScale = lngAxisMax

oAxisY.MajorUnitIsAuto = False
oAxisY.MinimumScale = lngAxisMin
oAxisY.MaximumScale = lngAxisMax

' set function to True (have completed code)
SquareScatter = True
Exit Function
fnError:
End Function

=================================================
Ed Ferrero
www.edferrero.com

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Square Charts in Excel 2007

Hi,

No new charts added in xl2007.
Maybe this will help,
http://peltiertech.com/Excel/Charts/SquareGrid.html

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Simon Jowitt" <Simon wrote in message
...
Has the new improved version of Excel got a function for producing square
grapsh (i.e. so the distance between units on the X and Y axes are equal)?
If
not, why not? Seriously though, any suggestions are welcome.

Simon


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
How do I a rotate my square radar chart (square-diamond)? Becs I Know Nathing Charts and Charting in Excel 5 April 3rd 23 07:30 PM
I need help with charts in Excel 2007 Movemout Charts and Charting in Excel 5 May 12th 07 03:39 AM
how to center a square plot area in a square chart xppuser Charts and Charting in Excel 2 March 11th 06 08:13 AM
regression lines and r-square in work sheets instead of charts Mathematically challenged Charts and Charting in Excel 0 December 2nd 05 02:08 AM
Regression Output -- R Square versus Adjusted R Square Bonnie Excel Discussion (Misc queries) 1 October 25th 05 12:55 AM


All times are GMT +1. The time now is 07:41 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"