Graph in Report - X Axis Titles

G

Guest

I have inserted a graph into an MS Access report that is based on a parameter
query. Once filtered down, there are three records. In each record is a
date field, for which I am using the yyyy format to display the year along
the X axis. The three records have dates of whatever month, whatever day,
and the years are 1997, 2001 and 2006. These are the only three years that
appear as titles along the X axis. How can I get each year between 1997 and
2006 to display as x axis titles?
 
R

Rob Parker

Hi Doug,

To get all years to display on the graph, you must have them in the
recordset for the graph - ie. in your query. You don't give any details of
what this query is, but here's a couple of suggestions.

If your query is a crosstab, you can force the years into the query by
including an IN clause after the PIVOT clause; something like:
... PIVOT MyYear IN (1997, 1998, 1999, ....)
If you're working in the query design grid, show the query property sheet
and enter the values in the Column Headings field.

If it's not a crosstab query, you'll need to add a year field by some other
method, such as a table (tblYears) containing a single field, YearsToShow,
and populated with the years you want. Add this table to your query, and
join the YearToShow field to your year field (which I'm guessing is a
calculated field from the date value). Click on the join, and select the
option to show all values from tblYears and only those records from your
existing table where the fields are equal. This should give you a recordset
with all years, but only values in the fields to be plotted for those with
data.

HTH,

Rob
 
G

Guest

Hi Doug,

Try this.

In Chart design view, click near X-axis. If you see Category Axis, double
click which will open Format Axis form.

You will see the following tabs.

Format Axis

Patterns Scale font Number Alignment

Click scale tab

you will see the following options which is editable.

Category (X) Axis Scale

Value (Y) Axis crosses at
category Number : 1

Number of Categories
between tick mark labels : 1

Number of Categories
between tick marks : 1

Edit and ensure that all are 1.

To view all years, this option

Number of Categories
between tick mark labels: 1

should be one.

Suppose say it is 2 and you have 10 values ( may be Years or whatever may
be) in X-Axis, in chart you will see five values.
( say for 2001 to 2010 it will be like 2002, 2004, 2006 .... )

You can change for various values and see the result in preview.

Good Luck,
Surendran
 

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