MSGraph: Setting X-Axis Major Unit Values

A

Alan Z. Scharf

Hi,

1. I have an MSGraph area chart in Access 2003 report with Years as the
X-Axis.

2. I want to set the X-axis scale for the Years column value which is in the
report's recordsource.

A. If the number of years is < 2, I'd like the graph to show intervals of
2-months apart in date format mm/31/yyyy.
B. If the number of years is between 2 and 6, I'd like to show 1 year
intervals in date format 12/31/yyyy.

3. I know how to set the major tick unit, e.g. 2 where I want 2 months
apart, but how do I spec


Reports!rptMultiManagerpage2![chtGrowthofThousand].Object.Application.Chart.
Axes(1).MajorUnit = 2

4. But, how do I specifiy that the major unit is to be Months or Years,
equivalent to setting the Days/Months/Years field in MSGraph Axis, Scales,
Major Unit section.

Thanks.

Alan
 
S

SA

Alan:

You set that by setting the number format for the value in the data series,
like this:

On Error Resume Next
Dim objGraph As Object
Dim objDS as Object
Set objGraph = Me!TheNameOfYourGraph.Object
Set objDS = objGraph.Application.DataSheet
'Singe decimal place, 200 data points
'Format is the same as Excel VBA
objDS.Range("A1:A200").NumberFormat = "#.0%" '<--Set the to months or
years
objGraph.Refresh
DoEvents
Set objGraph = Nothing
 
A

Alan Z. Scharf

Steve,

Thanks very much for your reply.

I will try that.

Alan

SA said:
Alan:

You set that by setting the number format for the value in the data series,
like this:

On Error Resume Next
Dim objGraph As Object
Dim objDS as Object
Set objGraph = Me!TheNameOfYourGraph.Object
Set objDS = objGraph.Application.DataSheet
'Singe decimal place, 200 data points
'Format is the same as Excel VBA
objDS.Range("A1:A200").NumberFormat = "#.0%" '<--Set the to months or
years
objGraph.Refresh
DoEvents
Set objGraph = Nothing
--
SA
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg


Alan Z. Scharf said:
Hi,

1. I have an MSGraph area chart in Access 2003 report with Years as the
X-Axis.

2. I want to set the X-axis scale for the Years column value which is in
the
report's recordsource.

A. If the number of years is < 2, I'd like the graph to show intervals of
2-months apart in date format mm/31/yyyy.
B. If the number of years is between 2 and 6, I'd like to show 1 year
intervals in date format 12/31/yyyy.

3. I know how to set the major tick unit, e.g. 2 where I want 2 months
apart, but how do I spec


Reports!rptMultiManagerpage2![chtGrowthofThousand].Object.Application.Chart.
Axes(1).MajorUnit = 2

4. But, how do I specifiy that the major unit is to be Months or Years,
equivalent to setting the Days/Months/Years field in MSGraph Axis, Scales,
Major Unit section.

Thanks.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top