TfrxChartView - AddXY vs. XSource/YSource

edited August 2017 in FastReport VCL 5
Hi,
in my application (C++ Embarcadero Tokyo 10.2, FR VCL5 - Embarcadero edition) is the report created dynamically at runtime.

I have inserted data as folows:

TfrxChartView * cv = new TfrxChartView;

TLineSeries * ls = new TLineSeries(NULL);
ls->AddXY(100,1000);
ls->AddXY(150,2000);
ls->AddXY(200,3000);
cv->Chart->AddSeries(ls);

...but no data are displayed (no curve) and cv->SeriesData->Count is zero !

Then I have tryed this:

cv->AddSeries(csLine);
cv->Chart->Series[0]->AddXY(100,1000);
cv->Chart->Series[0]->AddXY(150,2000);
cv->Chart->Series[0]->AddXY(200,3000);

cv->SeriesData->Count is 1, but there is no curve on chart again.

Only the way working correctly is to add data via
cv->SeriesData->Items[0]->XSource = "100;150;200";
cv->SeriesData->Items[0]->YSource = "1000;2000;3000";

But I would prefer the first way, because cv->Chart->Series has more properties then cv->SeriesData, for instance VertAxis, HorizAxis atc.

Any idea, please ?

Comments

  • gpigpi
    edited 5:16PM
    Use cv->Chart->Series for another properties, use cv->SeriesData->Items[0]->XSource for data
  • edited 5:16PM
    gpi wrote: »
    Use cv->Chart->Series for another properties, use cv->SeriesData->Items[0]->XSource for data

    Yes, it works ! Thanks a lot.

Leave a Comment