Built-in ChartSource lazarus / 55-TAChart ---------------------------------------------------------------------- wp · 2013-11-02 20:46 I am writing a utility which allows to convert a series to another type, i.e. a line series to a bar series etc. For passing the data of the old series to the new series I have to know whether the data originate from an external ChartSource or from the built-in source. In the first case, the external chart source only has to be linked to the new series while in the second case all data have to be copied to the built-in source of the new series. Initially I thought TChartSourceSeries.Source would be nil if the built-in source is used. But the getter method always returns a source, either the external or the built-in source. So, how can I determine if the property Source of a TChartSeries refers to the built-in or an external source? Lacking a straightforward solution I queried the name of the source which is hard-coded in TACustomSeries to be "Builtin" for the built-in one. But I think this is not very elegant and subject to error if this internal name changes. Code: [Select]function IsBuiltInChartSource(ASource: TCustomChartSource): Boolean; begin   Result := SameText(ASource.Name, 'Builtin'); end; ---------------------------------------------------------------------- fpcoder · 2013-11-07 00:38 This is even less straightforward than checking 'Builtin', but its a solution that popped up in my head: The Builtin ChartSource has a Tag property. Default is 0, so if you set the Tag property of all external sources to 1 at creation, you could then test for that instead of the name 'Builtin'. At least you wouldnt risk facing a name change of the BuiltIn property. Agreed, not as elegant as something like Series.UsingBuiltIn: true/false. ---------------------------------------------------------------------- wp · 2013-11-07 08:11 Sometimes Tag is not available because it is needed at application level by the user