Setting min and max values on chart's y-axis 
Author Message
 Setting min and max values on chart's y-axis

I have a chart object I have defined as:

     Dim objChart As Object
     Set objChart = Me!chtScores.Object

I have been able to set the HasLegend member with:

     objChart.HasLegend = False

however I am unable to set the min and max values of
the y-axis.  I assume I use the members MinimumScale
and MaximumScale like this:

     objChart.MinimumScale = 0
     objChart.MaximumScale = 10

however I get a run-time error 438 object doesn't support
this property or method.  If anyone could point out my
error it would be appreciated.

Thanks,

Jeff



Mon, 20 Jan 2003 03:00:00 GMT  
 Setting min and max values on chart's y-axis
Jeff,

MinimumScale and MaximumScale are properties of an Axis object, not the
Chartobject.
If you set a reference to Microsoft Graph 8.0 Object Library, you'll be able
to autolist the properties and methods instead of "coding blind" with late
object binding.  Plus you can then use the Object Browser (F2 from code).
Hence

Dim chtChart As Graph.Chart
dim axsYAxis as Graph.Axis
Set chtChart = Me!chtScores.Object
chtChart.HasLegend = False
set axsYAxis = chtChart.Axes(1)  ' I actually don't remember the index you
need to use.  Worth testing!
axsY.MinimumScaleIsAuto = False
axsY.MinimumScale = 0
axsY.MaximumScaleIsAuto = False
axsY.MaximumScale = 10
etc.

HTH,

Kevin



Mon, 20 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Programming the min and max values of an axis

2. Min & Max Values on Axis

3. Graph Axis Min & Max

4. Code to set Chart Y Axis value - Reply to SteveT

5. Code to set Chart Y Axis value needed

6. Can I change min max vallues in a CHART

7. Returning max and min column values

8. max / min value in a listbox

9. Finding Max or Min Values - HELP!!!!

10. Scrollbar problem with min and max values

11. Max and Min values

12. Vertical slider Max/Min values...

 

 
Powered by phpBB® Forum Software