Recent

Author Topic: [SOLVED] How to set text values for a point from Lineseries?  (Read 14891 times)

wp

  • Hero Member
  • *****
  • Posts: 13415
Re: How to set text values for a point from Lineseries?
« Reply #15 on: September 19, 2012, 06:27:19 pm »
Quote
I have recently implemented property editor for AxisIndexX/AxisIndexY properties
I saw this - it is great!

Quote
This is extremely rare operation, so I think that the current way is sufficient:
Code: [Select]
AddSeries(Series1);
Series1.Index ;= 0;
Oh - this is easy. I was not aware that the Index is writeable, and did it this way:
Code: [Select]
Chart1.AddSeries(Series1);
Chart1.Series.List.Move(Chart1.SeriesCount-1, 0);

CM630

  • Hero Member
  • *****
  • Posts: 1648
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: How to set text values for a point from Lineseries?
« Reply #16 on: September 21, 2012, 09:38:44 am »
Maybe it won't hurt if I mention, that this solution seems quite confusing (maybe not intuitive or nonstandard) to me.
Series1.index:= 0 seems to me like „delete series 0 and put series.index in its place", but in fact it does „increment the number of all series and put series.index in position 0“.
I suppose this is the reason why @wp did not expect that the index was writeable.
I if the index property of list boxes is writeable, just to find out that they do not have such a property.
As far as I remember, Lazarus's functionality about arrays is quite limited, if you think (maybe inserting series is really a rare case) it might be useful, I can try to spend some time to check how situation is.
« Last Edit: September 21, 2012, 09:47:06 am by paskal »
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: [SOLVED] How to set text values for a point from Lineseries?
« Reply #17 on: September 21, 2012, 12:39:25 pm »
This API does not belong to TAChart -- it is standard TCollection/TCollectionItem.
Moreover, it is required for integration with form designer and object inspector.

Since it is well-known to Delphi/FreePascal programmers, and quite rarely needed,
I think there is no reason to duplicate it.

Note btw that it applies to all collections -- for example, chart axes and tools of the toolset.

 

TinyPortal © 2005-2018