Chart not showing all data

G

Guest

(using Access 2000)

I want to create a XY Scatterline chart on a form. The x-axis is a lineal
distance (metres) and the y-axis is a roughness measurement. There is a
user-selected scale for the horizontal positions on the form that is set
before the form is opened.
I always want to put lines/labels etc on the form that overlap the chart.

So - here's what I've got so far:

Variables:
lngStart = The start of the section (x-axis)
lngEnd = The end of the section (x-axis)
lngScale = The user defined scale

Also:
Function twips(lngCentimetres as Long) as Long ' converts centimetres to twips

then, to open the form:

Dim frm as Form
Dim ctl as Control

Docmd.OpenForm "frmRoughness",acDesign

frm.Controls("RoughnessGraph").Left = 0
frm.Controls("RoughnessGraph").Top = 0
frm.Controls("RoughnessGraph").Width = twips((lngEnd - lngStart) / lngScale)
frm.Controls("RoughnessGraph").Height = twips(3)
frm.Controls("RoughnessGraph").BorderStyle = 1
frm.Controls("RoughnessGraph").BorderColor = 0
frm.Controls("RoughnessGraph").BorderWidth = 1

'make a label halfway through the graph
Set ctl = CreateControl(frm.name, acLine,,,,(((lngEnd - lngStart) /
lngScale) / 2), 0,0,twips(3))

'set the max and min scales of the x-axis so it shows only relevant data
frm.Controls("RoughnessGraph").Object.Application.Chart.Axes(1).MinimumScale
= lngStart
frm.Controls("RoughnessGraph").Object.Application.Chart.Axes(1).MaximumScale
= lngEnd

Obviously I've cut this down so the main parts are in here.
Now - the chart has the SizeMode set to Zoom.

Ok - this works fine if the selected section is not very big. But - when I
get a large section, it cuts the end of the data off. So - I set the chart
to size mode Stretch, but then it still only displays 'most' of the data,
then cuts the end off, then the controls I've placed on the form become out
of sync with the Chart.

I've checked that the data is in the Query it is based on, and in the
DataSheet the Chart is based on and it is all there.

Another thing: When I double click on the chart when in design view, the
ChartArea only shows to where it stops, but can be stretched out further.
When I do this though, it doesn't save.

So - I'm stumped!

Is there a maximum chart width or something that I am missing?
Do I need to set the ChartArea or PlotArea to be greater? I thought this
might have been handled because I made the original chart (RoughnessGraph)
rather wide (like wider than it would ever be) originally.

Can anybody lend a helping hand?

Regards,
Peter Hill
 

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