Jump to content

Dynamic Series in TUniChart


Recommended Posts

hi,

 

I'm trying to add series in a chart by the result of an query. But it will not work.

I tried something like that

 

    while not dm.qTemp.Eof do
    begin
        TmpSeries := tUniLineSeries.Create(Ch_Quoten);
        TmpSeries.Name := 'Series' + dm.qTempKennung.AsString;
        TmpSeries.Title := 'LC' + dm.qTempKennung.AsString;
        Ch_Quoten.SeriesList.Add(TmpSeries);
        dm.qTemp.Next;
    end;

 

Can anyone tell me, what I have to do, to make this work?

 

Regards

Marius

 

Link to comment
Share on other sites

  • 7 months later...

Hi

 

Please try this code as it has worked for me successfully:

 

     icount := InterlockedIncrement( iNamesCounter );
     HorizBarSeries := TUniHorizBarSeries.Create( Chart );
     HorizBarSeries.Parent := Chart;
     HorizBarSeries.Name := 'Horizbar' + IntToStr(icount);

 

This can be in a loop, but notice that the PARENT and NAME properties are critical to the objects being freed.

 

NOTE: DO NOT alter the CHART.SERIESLIST list, as the PARENT property will do that for you.

 

Stiaan

Link to comment
Share on other sites

  • 2 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...