[ANSWERED] scroll in chart scline, with multiple axes

TeeChart for ActiveX, COM and ASP
Post Reply
jika
Newbie
Newbie
Posts: 27
Joined: Mon Mar 18, 2013 12:00 am

[ANSWERED] scroll in chart scline, with multiple axes

Post by jika » Tue Mar 26, 2013 8:04 pm

look at the first attachment,
I have 7 scline in a chart with multiple axes on the Y axis
Scline one is attached to the first custom axis (0.04 to 0.4)
the other 6 are attached to the second custom axis (0 to 200)
when I scroll up the second chart (0-200), the scline reach the first chart (see the second attachment)
the scline should not exceed the limits of their axis, they must disappear.

Note: this chart has 2 axis customs. On axis Y.
Has No custom chart this axis is absice.

How to scline that remain within the limits of their axes.
Attachments
steemma scroll in chart scline with MULTIPLE AXES 2.PNG
steemma scroll in chart scline with MULTIPLE AXES 2.PNG (64.44 KiB) Viewed 11571 times
steemma scroll in chart scline with MULTIPLE AXES 1.PNG
steemma scroll in chart scline with MULTIPLE AXES 1.PNG (54.33 KiB) Viewed 11588 times
Last edited by jika on Tue Apr 09, 2013 8:20 am, edited 1 time in total.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: scroll in chart scline, with multiple axes

Post by Yeray » Wed Mar 27, 2013 12:33 pm

Hello,

It looks as what is shown in the "Opaque Zones" example in the features demo.
Find in at "All Features\Welcome !\Axes\Opaque zones".
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jika
Newbie
Newbie
Posts: 27
Joined: Mon Mar 18, 2013 12:00 am

Re: scroll in chart scline, with multiple axes

Post by jika » Wed Mar 27, 2013 2:39 pm

HELLO
I am a new user
I do not know where is the demo
"Opaque areas" example in the demo features.
Find in at "All Features \ Welcome! \ Axes \ Opaque areas".
What is "All Features \ Welcome! \ Axes \ Opaque areas"

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: scroll in chart scline, with multiple axes

Post by Sandra » Wed Mar 27, 2013 3:24 pm

Hello jika

You must open the project TeeChart Activex Pro V2012 you will find as shortcut in the Program Group of start menu or in a similar path as next C:\Program Files\Steema Software\TeeChart Pro v2012 ActiveX Control\Examples\Visual Basic\TeeChartAXV2012Demo and run the TeeChartAxV2012.exe. After you execute the demo please go to tab All Features \ Welcome! \ Axes \ Opaque areas. See next image to understand good my indications:
OpaqueZonesExample.jpg
OpaqueZonesExample.jpg (205.36 KiB) Viewed 11510 times
I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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

jika
Newbie
Newbie
Posts: 27
Joined: Mon Mar 18, 2013 12:00 am

Re: scroll in chart scline, with multiple axes

Post by jika » Thu Mar 28, 2013 2:34 pm

Thank you very much.
but is it possible to scroll in one or other of the chart. I do not want to scroll all the chart at the same time
i have a chart with one main axis
and one custom axis
thank you
Attachments
AXE MULTIPLE 3.PNG
AXE MULTIPLE 3.PNG (30.35 KiB) Viewed 11508 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: scroll in chart scline, with multiple axes

Post by Yeray » Tue Apr 02, 2013 10:44 am

Hello,

To scroll/zoom each zone individually you should disable the default scroll/zoom feature and implement your version of it.
For example, this seems to work in the opaque zones example mentioned above:

Code: Select all

Dim MouseDownX, MouseDownY, custAxisIndex As Integer
Dim inLeft As Boolean

Private Sub Form_Load()
  With TChart1    
    .Zoom.Enable = False
    .Scroll.Enable = pmNone
    MouseDownX = -1
    MouseDownY = -1
    custAxisIndex = -1
    inLeft = False
  End With
End Sub

Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
  If Button = mbRight And _
     X > TChart1.Axis.Bottom.IStartPos And X < TChart1.Axis.Bottom.IEndPos And _
     Y > TChart1.GetChartRect.Top And Y < TChart1.GetChartRect.Bottom Then
    Dim i As Integer
    For i = 0 To TChart1.Axis.CustomCount - 1
      If Y > TChart1.Axis.Custom(i).IStartPos And Y < TChart1.Axis.Custom(i).IEndPos Then
        custAxisIndex = i
        Exit For
      End If
    Next i
    
    If custAxisIndex = -1 And _
       Y > TChart1.Axis.Left.IStartPos And Y < TChart1.Axis.Left.IEndPos Then
      inLeft = True
    End If
    
    MouseDownX = X
    MouseDownY = Y
  End If
End Sub

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
  If MouseDownX <> -1 And MouseDownY <> -1 Then
    If custAxisIndex > -1 Then
      With TChart1.Axis.Custom(custAxisIndex)
        tmpIncr = .CalcPosPoint(MouseDownY - Y) - .CalcPosPoint(0)
        .SetMinMax .Minimum + tmpIncr, .Maximum + tmpIncr
        MouseDownY = Y
      End With
    Else
      If inLeft Then
        With TChart1.Axis.Left
          tmpIncr = .CalcPosPoint(MouseDownY - Y) - .CalcPosPoint(0)
          .SetMinMax .Minimum + tmpIncr, .Maximum + tmpIncr
          MouseDownY = Y
        End With
      End If
    End If
    
    With TChart1.Axis.Bottom
      tmpIncr = .CalcPosPoint(MouseDownX - X) - .CalcPosPoint(0)
      .SetMinMax .Minimum + tmpIncr, .Maximum + tmpIncr
      MouseDownX = X
    End With
  End If
End Sub

Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
  MouseDownX = -1
  MouseDownY = -1
  custAxisIndex = -1
  inLeft = False
End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply