Chart completion from Script

Top  Previous  Next

Let's look at how to construct the previous chart using a script. Leave the Label and Y fields empty in the chart editor. In the report script enter the following code:

 

PascalScript:

 

begin

 Chart1.SeriesData[0].XSource := 'Jan;Feb;Mar;Apr';

 Chart1.SeriesData[0].YSource := '31;28;31;30';

end.

 

C++Script:

 

{

 Chart1.SeriesData[0].XSource = "Jan;Feb;Mar;Apr";

 Chart1.SeriesData[0].YSource = "31;28;31;30";

}

 

SeriesData[0] in this case allows us to set parameters for the first series in the chart. If the chart has more than one series then refer to them with SeriesData[1], etc.