Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Unhappy changing the scale on the graph

Sub chart()

End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 17/01/2007 by 01pervezm
'

'
Charts.Add
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B4"), PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "chart"
.Axes(xlCategory).HasTitle = True
.Axes(xlCategory).AxisTitle.Characters.Text = "x"
.Axes(xlSeries).HasTitle = False
.Axes(xlValue).HasTitle = True
.Axes(xlValue).AxisTitle.Characters.Text = "z"
End With
End Sub
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 17/01/2007 by 01pervezm
'

'
Range("A1:B4").Select
Charts.Add
ActiveChart.ChartType = xlBarClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B4"), PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "chart"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "x"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "y"
End With
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub


this is a code, we were wondering if this code could be modified so it automaticly alters the values to suit the new data inputed.
excel does this by default.
Basicaly wut she's tryin 2 say is how do u make the x axis bigger (by not making the others smaller.
  #2   Report Post  
aly aly is offline
Junior Member
 
Location: in my house??
Posts: 8
Talking

yo yo lol ict cw whooo x x x
  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default changing the scale on the graph

None of this code adjusts the axis scale. Excel will just use its own
defaults.
In a column chart, you have hardly any influence over the category (X) axis
scale. In a 3D column chart, you have hardly any effect over most other
features of the chart, but it hardly matters since it's not legible anyway.

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


"maryam" wrote in message
...

Sub chart()

End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 17/01/2007 by 01pervezm
'

'
Charts.Add
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B4"),
PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "chart"
Axes(xlCategory).HasTitle = True
Axes(xlCategory).AxisTitle.Characters.Text = "x"
Axes(xlSeries).HasTitle = False
Axes(xlValue).HasTitle = True
Axes(xlValue).AxisTitle.Characters.Text = "z"
End With
End Sub
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 17/01/2007 by 01pervezm
'

'
Range("A1:B4").Select
Charts.Add
ActiveChart.ChartType = xlBarClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B4"),
PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "chart"
Axes(xlCategory, xlPrimary).HasTitle = True
Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "x"
Axes(xlValue, xlPrimary).HasTitle = True
Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "y"
End With
With ActiveChart
HasTitle = False
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub


this is a code, we were wondering if this code could be modified so it
automaticly alters the values to suit the new data inputed.
excel does this by default.
Basicaly wut she's tryin 2 say is how do u make the x axis bigger (by
not making the others smaller.




--
maryam



  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,344
Default changing the scale on the graph

Hi,

Modifying the size of the X-axis can be done in anyone of these ways:

1. Increase the Font Size of the X-axis items.
2. You can insert blank rows (or columns) between each x-axis set of data
in the spreadsheet. The extra tick marks can be removed on the scale tab.
3. You can resize the Plot Area - make it wider.
4. You can increase the horizontal size of the entire chart.

All of the above can be done manually or via vba. Try recording it.

An if its a 3-D chart you have similar options plus you can work with the
3-D attributes.
--
Cheers,
Shane Devenshire


"Jon Peltier" wrote:

None of this code adjusts the axis scale. Excel will just use its own
defaults.
In a column chart, you have hardly any influence over the category (X) axis
scale. In a 3D column chart, you have hardly any effect over most other
features of the chart, but it hardly matters since it's not legible anyway.

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


"maryam" wrote in message
...

Sub chart()

End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 17/01/2007 by 01pervezm
'

'
Charts.Add
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B4"),
PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "chart"
Axes(xlCategory).HasTitle = True
Axes(xlCategory).AxisTitle.Characters.Text = "x"
Axes(xlSeries).HasTitle = False
Axes(xlValue).HasTitle = True
Axes(xlValue).AxisTitle.Characters.Text = "z"
End With
End Sub
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 17/01/2007 by 01pervezm
'

'
Range("A1:B4").Select
Charts.Add
ActiveChart.ChartType = xlBarClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B4"),
PlotBy:= _
xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "chart"
Axes(xlCategory, xlPrimary).HasTitle = True
Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "x"
Axes(xlValue, xlPrimary).HasTitle = True
Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "y"
End With
With ActiveChart
HasTitle = False
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub


this is a code, we were wondering if this code could be modified so it
automaticly alters the values to suit the new data inputed.
excel does this by default.
Basicaly wut she's tryin 2 say is how do u make the x axis bigger (by
not making the others smaller.




--
maryam




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 Y Axis Scale with percentages (Line Graph) p-diddy Charts and Charting in Excel 2 December 21st 06 02:25 PM
Changing Time Scale to Seconds on Excel Chart JaneinPA Charts and Charting in Excel 2 March 8th 06 09:29 PM
Changing the scale major unit in a graph Ant Excel Discussion (Misc queries) 2 February 6th 06 01:42 PM
changing the color of a single bar on a graph Brian Charts and Charting in Excel 1 November 22nd 05 04:55 PM
Bar graph values keep changing Mike82j2000 Charts and Charting in Excel 1 January 6th 05 01:27 PM


All times are GMT +1. The time now is 11:12 AM.

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"