Page 1 of 1

Setting Axis minimum values

Posted: Tue Apr 06, 2004 6:35 pm
by 6924636
Saludos a Todos!

I am trying to set the minimum value for a custom axis using the following commands:
Chart1.Axis.Custom(axisID).automatic = false
Chart1.Axis.Custom(axisID).AutomaticMinimum = false
Chart1.Axis.Custom(axisID).Minimum = 210

It doesn't matter where I place it after creating the axis , I get the following error:

error '8000ffff'

What is this telling me? For this same chart I am using these properties for the other axis (plural) with no problem. Any ideas?

¡Agradezco cualquier ayuda!
¡Gracias!
-cg :)

Posted: Tue Apr 06, 2004 7:29 pm
by Pep
Hola Carol,

have you tried to add the Environment.InternalRepaint line before to set the minimum ?

Code: Select all

With TChart1
    .Environment.InternalRepaint
    .Axis.Custom(0).AutomaticMinimum = False
    .Axis.Custom(0).Minimum = 210
End With

Setting Axis minimum values

Posted: Wed Apr 07, 2004 5:18 pm
by 6924636
Hola de nuevo,

Sabes, no me dio resultado. Me sigue dando el mismo error.

Is there a sequence I should follow in creating axes and adding series? Am I supposed to create all axes first?

¡Gracias!
-cg :) [/code]

Setting Axis minimum values

Posted: Wed Apr 07, 2004 9:37 pm
by 6924636
Para agregar,

Ok... I've created an as-is example to show what I am doing and how I can't seem to set the .minimum property for custom axis 1 to anything else other than 0. I've placed it in the attachments newsgroup. I've moved around where I create the axis and I get the same results and I've moved around where I set this property, so I don't think it has anything to do with sequence. Please let me know what I'm missing or not seeing here, if possible...

¡Disfrutenlo!
-cg

Posted: Thu Apr 08, 2004 8:07 am
by Chris
Hola Carol,

Well, it looks as though the sequence is important here ... moving the IAxis.Minimum code to after the custom axis has been associated to a series seems to do the trick, e.g.

Code: Select all

Sub FillChart(ByRef Chart1)
  
  with Chart1
    for i = 0 to 4
      .AddSeries(0)	' add line  
      .Series(i).FillSampleValues(288)
    next
    
    .Series(1).VerticalAxis = 1
    .Series(2).VerticalAxisCustom = 0
    .Series(3).VerticalAxisCustom = 1

    Dim Max
    .Axis.Custom(1).AutomaticMaximum = true
    .Axis.Custom(1).AutomaticMinimum = false
    .Environment.InternalRepaint
    Max = .Axis.Custom(1).Maximum
    .Axis.Custom(1).Title.Caption =  .Axis.Custom(1).Title.Caption & " " & Max
    Max = Max - 500
   .Axis.Custom(1).Minimum = Max
  
  end with
End Sub
Que te vaya bien!

Setting Axis minimum values

Posted: Thu Apr 08, 2004 2:07 pm
by 6924636
¡Fíjate!

I had only moved the .minimum = x statement around not the whole .AutomaticMimimum stuph.... This did do the trick!

¡Gracias por tu ayuda e igualmente!
-cg :)