I used TfrxChart controls in the report, the name is chart1, before printing need according to the actual data to draw graphics
According to the original I use the Tchart controls the habit of writing code is as follows,
Compiled found in addition to the revision of the Series title [0] other commands are invalid,
Unable to remove existing curve cannot show the new curve,
Use MyChart. SeriesData. Clear to Clear existing graphics, but the other command is still invalid
Procedure TForm1. FrxReport2BeforePrint (c: TfrxReportComponent);
Var
MyChart: TfrxChartView;
I, j: Integer;
The begin
If c is TfrxChartView then
The Begin
MyChart:=TfrxChartView (c);
If MyChart. Name='Chart1 Then
The Begin
//MyChart. SeriesData. The Clear;
MyChart. Chart. The Series [0]. Title:='good';
MyChart. Chart. The Series [0]. The Clear;
MyChart. Chart. The Series [1]. The Clear;
For I:=1 To 100 Do
MyChart. Chart. The Series [0]. AddXY (I, I, 'test1);
For j:=1 To 100 Do
MyChart. Chart. The Series [1]. The AddXY (j, 100 - j, 'test2');
The End;
The End;
end;
CodePudding user response:
Series created to add all no problem after the key is to add in the Series data is shown not to come out,