display not showing correctly

TeeChart for ActiveX, COM and ASP
Post Reply
sunman4008
Newbie
Newbie
Posts: 18
Joined: Tue Apr 09, 2013 12:00 am

display not showing correctly

Post by sunman4008 » Wed Dec 18, 2013 1:24 am

Hello,

Please see attached chart I have included. I have the following questions:
1. The scroll bar is not at the end. How do I move it to the end i.e. far right?
2. The data is daily data but it is crunching everything up. How do I show 1 years of data per screen and then allow a scroll back?
3. Once I do number 2, is there an easy way to set the y-axis for the min./max prices instead of calculating each?

-Mike
Attachments
chart.png
chart.png (59.94 KiB) Viewed 7803 times

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

Re: display not showing correctly

Post by Yeray » Thu Dec 19, 2013 11:58 am

Hi Mike,
sunman4008 wrote:1. The scroll bar is not at the end. How do I move it to the end i.e. far right?
You can control the scroll bar manually setting it's Min, Max and Value properties. If you want it at the end, you just have to set Value=Max.
sunman4008 wrote:2. The data is daily data but it is crunching everything up. How do I show 1 years of data per screen and then allow a scroll back?
You can use the pagination feature or to manually control the bottom axis Minimum and Maximum properties. See the Tutorial 3 - Chart Paging and Tutorial 4 - Axis Control.
You can use the ScrollBar Change event to call the Page.Next/Page.Previous (if you go for the pagination) or the Axis.Bottom.SetMinMax (if you go for the manual control of the bottom axis) functions.
sunman4008 wrote:3. Once I do number 2, is there an easy way to set the y-axis for the min./max prices instead of calculating each?
If you want to fix the left axis to the absolute minimum and maximum values in your series, you can just let the chart to calculate it for you (forcing a repaint before changing any axis scale) and set the left axis Automatic property to False so it won't be further recalculated.

Code: Select all

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

  TChart1.AddSeries scCandle
  TChart1.Series(0).FillSampleValues 1000
  
  TChart1.Environment.InternalRepaint
  TChart1.Axis.Left.Automatic = False
  
  HScroll1.Max = Year(TChart1.Series(0).XValues.Maximum)
  HScroll1.Min = Year(TChart1.Series(0).XValues.Minimum)
  HScroll1.Value = HScroll1.Max
End Sub

Private Sub HScroll1_Change()
  TChart1.Axis.Bottom.SetMinMax CDate("1/1/" + Str$(HScroll1.Value)), CDate("31/12/" + Str$(HScroll1.Value))
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