LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 19
Default x-axis scale changes

I have a macro that automatically generates a new chart from data in a
worksheet. When I run my macro, charts that have been created prior
will have the same min x-axis scale as the new chart generated.
However the recently generated chart looks perfect. How do I make the
old charts and new charts independent from each other? Whenever I
create a new chart I'm using the charts.add function


Set xlChart = Charts.Add
With xlChart
.ChartWizard Source:=GanttChartRange, Gallery:=xlBar,
Format:=3, PlotBy:=xlColumns, CategoryLabels:=1, SeriesLabels:=1,
HasLegend:=1, Title:=Title, CategoryTitle:="", ValueTitle:="",
ExtraTitle:=""
.SeriesCollection(1).Border.LineStyle = xlNone
.SeriesCollection(1).Interior.ColorIndex = xlNone
.Axes(xlCategory).ReversePlotOrder = True
.Axes(xlCategory).Crosses = 4 'TaskCount
.Axes(xlValue).MinimumScale = minXscale 'minXscale is a cell
on the worksheet min value of x-axis
.Axes(xlValue).TickLabels.Font.Name = "Arial"
.Axes(xlValue).TickLabels.Font.Size = 10
.Axes(xlCategory).TickLabels.Font.Name = "Arial"
.Axes(xlCategory).TickLabels.Font.Size = 12
.Legend.Font.Name = "Arial"
.Legend.Font.Size = 12
.HasTitle = True
.ChartTitle.Text = Range("GanttTitle").Value
.ChartTitle.Font.Name = "Arial"
.ChartTitle.Font.Size = 15
.ChartTitle.Font.Bold = False
End With

this code is courtesy of Dave Steppan,
http://www.geocities.com/SiliconVall...1030/gantt.zip

thanks,
 
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 to draw chart: log scale on X axis, natural scale on y axis? Pratap D. chavan Charts and Charting in Excel 1 November 16th 06 08:03 AM
How do I reference x-axis or y-axis scale values to a worksheet ce retro5726 Excel Discussion (Misc queries) 0 August 10th 06 01:46 AM
How to make Primary axis and Secondary X-axis have the same scale AdamCPTD Excel Discussion (Misc queries) 0 July 14th 06 02:14 PM
Format Axis; Scale Tab; "Value Axis Crosses At" ends with preposit Pedant Charts and Charting in Excel 1 August 29th 05 03:50 AM
How to insert X axis scale values next to axis and X axis grid lin vp23larry Charts and Charting in Excel 2 June 23rd 05 03:45 PM


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