adjust axis range and major units in xy-chart to data series values

B

biker

I have several msgraph xy-chart subforms on a ms access (main) form.
The data series in the subforms are different for each record of the
main form. Subform and main form are linked by a single date field.
Each record on the main form shows a single day. The subform shows a
time interval of that day on the x-axis and the values of a weather
element on the y-axis.

The values of the data series on the y-axis in the subform vary with
the weather, the seasons, and the time of the day. The width of the
time interval on the x-axis also varies from day to day. The charts
work fine, but the ranges of the x-axis and the y-axis are
oncontrollable when using automatic scaling. I could set the range to
the minimum and the maximum values of the data series, but then there
will be too much unused space inside the graph. To make sure that the
chart is maximally informative, I want to restrain the scale of both
the x-axis and the y-axis, so that there is only minimally unused
space in the graph.

So what I want to do, is to have the min and max scale of the x-axis
set to the min and max value of the x data series (rounded at full
hours) within the current record of the main form. And to do the same
regarding the min and max scale of the y-axis (rounded at an integer
value). In other words: the min and max values of the current record
in the main form should be used as a basis for scaling the x-axis and
the y-axis.

I hope I have made my problem clear. I have searched all over the
internet and haven't found a single clue about how to do this (though
I think might be a fairly everyday problem).

I hope there is someone on the forum who has a workable idea about how
to get this done. I think perhaps VBA should be used in an event
procedure starting from the main form at the OnCurrent event. But I am
not too familiar with VBA and I could be wrong.
 

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