Question

Can I use paging and scrollAxis Tool together because once we do a Scroll and after that try to do next page or prev page using page Number tool it doesn't work.

Thanks Akshay

Was it helpful?

Solution

I'm not sure about what TeeChart ActiveX version are you using nor what exact tool are you using.

With TeeChart v2013.0.1.1 I can have a tcAxisScroll tool linked to the bottom axis and I can still both dragging the chart with the right mouse button (default feature) and dragging the bottom axis with the left mouse button (tcAxisScroll tool):

Private Sub Form_Load()
  TChart1.Aspect.View3D = False

  TChart1.AddSeries scLine
  TChart1.Series(0).FillSampleValues 100

  TChart1.Axis.Bottom.SetMinMax 0, 20

  TChart1.Tools.Add tcAxisScroll
  TChart1.Tools.Items(0).asAxisScroll.Axis = TChart1.Axis.Bottom
End Sub

On the other hand, you may be using the Paging feature in conjunction with the tcPageNumber tool. In that case, you are right, the I'm afraid the Paging feature wasn't designed to work in conjunction with the default drag-to-scroll feature.

Private Sub Form_Load()
  TChart1.Aspect.View3D = False

  TChart1.AddSeries scLine
  TChart1.Series(0).FillSampleValues 100

  TChart1.Page.MaxPointsPerPage = 20
  TChart1.Tools.Add tcPageNumber
End Sub

As you say, as soon as you drag the chart to scroll, the tcPageNumber tool stops working. This is because dragging the chart, you change the axis range and the tool only works when you haven't changed the scale. So you can easily fix it forcing the axis to be Automatic as soon as the tool is being pressed, at the OnPageChange event:

Private Sub TChart1_OnPageChange()
  TChart1.Axis.Bottom.Automatic = True
End Sub
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top