Recent

Author Topic: Looking for a TAchart (line) time example - or just help[SOLVED]  (Read 5549 times)

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: Looking for a TAchart (line) time example - or just help[SOLVED]
« Reply #15 on: November 28, 2019, 12:05:09 am »
Try this, it's simpler and more logical. It logs the index used in the LIMITS array in an integer variable CurrIndexToLimits. When the new data point runs over the right extent the index is incremented to use the next LIMITS element. This goes on until the last LIMITS element has been reached which is used further on.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.ExpandXRange(x: Double);
  2. var
  3.   ext: TDoubleRect;
  4. begin
  5.   ext := Chart1.GetFullExtent;
  6.   if x > ext.b.x then begin
  7.     inc(CurrIndexToLimits);
  8.     if CurrIndexToLimits > High(LIMITS) then CurrIndexToLimits := High(LIMITS);
  9.     Chart1.Extent.XMax := Chart1.Extent.XMax + LIMITS[CurrIndexToLimits];
  10.     iIntoLimits.Text := IntToStr(CurrIndexToLimits);
  11.   end;
  12. end;  

Of course, CurrIndexToLimits must be initialized to 0 in the Button1Click handler.



jbmckim

  • Full Member
  • ***
  • Posts: 144
Re: Looking for a TAchart (line) time example - or just help[SOLVED]
« Reply #16 on: November 28, 2019, 01:53:21 am »
Thanks!  I'll check it this weekend but...probably not tomorrow as tomorrow will consist of a calorie coma to the accompaniment of football.

Which brings me to my next point.  I LOVE (and am thankful for) the level of support with Lazarus.  It is fast, free, often offers multiple possibilities and best of all, almost always solves my problem.  Our small company has paid for MS support and their first question is always is something like:   "Can you please tell me every version you've ever had, heard or thought of, of every MS product since Bill Gates was born?" 

To all that, Lazarus responds:  1) Hold my beer  2) Would you like that in Linux and Mac OS too?

These are the primary reasons we went to L P for our next generation of product.

So...Thanks!


 

TinyPortal © 2005-2018