Setting Axis minimum values

TeeChart for ActiveX, COM and ASP
Post Reply
Carol
Newbie
Newbie
Posts: 7
Joined: Fri Nov 15, 2002 12:00 am
Location: Arlington, Tx
Contact:

Setting Axis minimum values

Post by Carol » Tue Apr 06, 2004 6:35 pm

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 :)

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Apr 06, 2004 7:29 pm

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

Carol
Newbie
Newbie
Posts: 7
Joined: Fri Nov 15, 2002 12:00 am
Location: Arlington, Tx
Contact:

Setting Axis minimum values

Post by Carol » Wed Apr 07, 2004 5:18 pm

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]

Carol
Newbie
Newbie
Posts: 7
Joined: Fri Nov 15, 2002 12:00 am
Location: Arlington, Tx
Contact:

Setting Axis minimum values

Post by Carol » Wed Apr 07, 2004 9:37 pm

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Thu Apr 08, 2004 8:07 am

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!
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Carol
Newbie
Newbie
Posts: 7
Joined: Fri Nov 15, 2002 12:00 am
Location: Arlington, Tx
Contact:

Setting Axis minimum values

Post by Carol » Thu Apr 08, 2004 2:07 pm

¡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 :)

Post Reply