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 11:25PM
    Use cv->Chart->Series for another properties, use cv->SeriesData->Items[0]->XSource for data
  • edited 11:25PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.