Axes Scale problem

TeeChart for ActiveX, COM and ASP
Post Reply
Faizullah Khan
Newbie
Newbie
Posts: 50
Joined: Wed Apr 26, 2006 12:00 am

Axes Scale problem

Post by Faizullah Khan » Mon Dec 04, 2006 11:15 am

Hi
I am sending this line of code ,I set the automatic increment for Axes to false and Evaluate the Axes on the basis of values assigned to Chart.

The labels on the Axes or not properly displayed ,The Minimum value for X and Y axis is not properly labled at the Crossing point of X,Y axis.

I sending Code and also attachment for description.

Code: Select all

Private Sub Form_Load()
 
  TeeCommander1.Chart = TChart1
  TChart1.ClearChart
  TChart1.Panel.Color = vbWhite
  '
  ' Remove grid lines
  '
  TChart1.Axis.Bottom.GridPen.Visible = False
  TChart1.Axis.Left.GridPen.Visible = False
  TChart1.Aspect.View3D = False
  
  TChart1.Legend.LegendStyle = lsSeries
  TChart1.Axis.Left.Title.Caption = " Left Title"
  TChart1.Axis.Bottom.Title.Caption = "Right Title"
  TChart1.Header.Text.Clear
  TChart1.Header.Text.Add ("Test Chart")
  
  TChart1.AddSeries scLine

  TChart1.Series(0).XValues.Order = loNone
  TChart1.Series(0).YValues.Order = loNone
  
  TChart1.Series(0).Color = vbBlue
  
  TChart1.Axis.Left.AutomaticMaximum = False
  TChart1.Axis.Left.AutomaticMinimum = False
  
  TChart1.Axis.Bottom.AutomaticMaximum = False
  TChart1.Axis.Bottom.AutomaticMinimum = False
  
' set start up value for X and Y-Axis
  
  TChart1.Axis.Bottom.Maximum = 273.15
  TChart1.Axis.Bottom.Minimum = 273.15
  
  TChart1.Axis.Left.Maximum = 0.000439826
  TChart1.Axis.Left.Minimum = 0.000439826
  
  
  AddValue 273.15, 0.0243884
  AddValue 275, 0.0221781
  AddValue 277, 0.019932
  AddValue 279, 0.0178038
  AddValue 281, 0.0157854
  AddValue 283, 0.013871
  AddValue 285, 0.0120655
  AddValue 287, 0.0103616
  AddValue 289, 0.00875473
  AddValue 291, 0.00724847
  AddValue 293, 0.00584231
  AddValue 295, 0.00454165
  AddValue 297, 0.00334514
  AddValue 299, 0.00225734
  AddValue 301, 0.0012822
  AddValue 303, 0.000439826
  AddValue 304.22, 0
  
  'TChart1.Axis.Bottom.Minimum = 273.15
  'TChart1.Axis.Bottom.Maximum = 305
  TChart1.Axis.Bottom.Increment = 2
  TChart1.Axis.Bottom.Labels.ValueFormat = "0.00"

  'TChart1.Axis.Left.Maximum = 0.0243884
  'TChart1.Axis.Left.Minimum = 0.000439826
  TChart1.Axis.Left.Increment = 0.005
  TChart1.Axis.Left.Labels.ValueFormat = "00.00"
 
 End Sub

Code: Select all

Private Sub AddValue(X As Double, Y As Double)

    If X = 0 Or Y = 0 Then
        TChart1.Series(0).AddXY X, Y, "", clNone
    Else
        TChart1.Series(0).AddXY X, Y, "", clTeeColor
        '
' Evaluate minimum/maximum value for Y-Axis
'
        If Y > TChart1.Axis.Left.Maximum Then
          TChart1.Axis.Left.Maximum = Y
        End If
        If Y < TChart1.Axis.Left.Minimum Then
          TChart1.Axis.Left.Minimum = Y
        End If
'
' Evaluate minimum/maximum value for X-Axis
'
        If X > TChart1.Axis.Bottom.Maximum Then
          TChart1.Axis.Bottom.Maximum = X
        End If
        If X < TChart1.Axis.Bottom.Minimum Then
          TChart1.Axis.Bottom.Minimum = X
        End If

    End If
End Sub
Thanks wit regards

Faizullah Khan
Newbie
Newbie
Posts: 50
Joined: Wed Apr 26, 2006 12:00 am

Post by Faizullah Khan » Tue Dec 05, 2006 6:06 am

Hi

I send test project on Narcis email address ,Kindly review the project OR test this code in visual basic 6.0 . its urgent

We are using VB 6.0 and TeeChart v7

Thanks with regard

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Dec 05, 2006 10:49 am

Hi Faizullah,

The easiest way to achieve that is using custom labels as shown at the All Features\Welcome!\Axes\Labels\Custom Labels example in the features demo. You'll find the features demo at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Faizullah Khan
Newbie
Newbie
Posts: 50
Joined: Wed Apr 26, 2006 12:00 am

Post by Faizullah Khan » Tue Jan 09, 2007 8:04 am

Hi

Custom lablels works fine ,
But When We change desired increment to axis from TeeChart Editor (i.e Change desired increment from 10 to 15) desired increment is not updated on the TeeChart.

Code: Select all

TChart1.Axis.Bottom.Labels.Clear

' custom labels for X axis

For lLabel = TChart1.Axis.Bottom.Minimum To TChart1.Axis.Bottom.Maximum Step lIncrement
  TChart1.Axis.Bottom.Labels.add lLabel , lLabel
Next lLabel 

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 09, 2007 8:53 am

Hi Faizullah,

When using custom labels axis increment and automatic labeling options are not considered. If you want to change the increment using custom labels you should clear them and add new custom labels according to the new increment.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Faizullah Khan
Newbie
Newbie
Posts: 50
Joined: Wed Apr 26, 2006 12:00 am

Post by Faizullah Khan » Tue Jan 09, 2007 9:19 am

Hi

What event of TeeChart is fired when we change the Desired increment to Axis from TeeChart Editor

Regards

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 09, 2007 9:23 am

Hi Faizullah,

You can try with TeeCommander's OnEditedChart event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Faizullah Khan
Newbie
Newbie
Posts: 50
Joined: Wed Apr 26, 2006 12:00 am

Post by Faizullah Khan » Tue Jan 09, 2007 9:58 am

Hi

This event only fire when we close the TeeCommander , we need to update the TeeChart as soon as we change the Desired increment to axis or any other property of TeeChart from the Editor.

Regards
Faizullah

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

Post by Pep » Mon Jan 15, 2007 11:46 pm

Hi,

I'm afraid there's not other way to catch them for the moment. I've added on our wish list to be considered to inclusion for the next releases.

Post Reply