Я использую Fast Reports 4.13.1. Мне нужно отобразить несколько диаграмм в моем сводном диапазоне, и я пытаюсь их динамически создать в обработчике событий OnBeforePrint
. Проблема в том, что диаграммы создаются правильно, в серии не отображаются данные, которые я добавляю к ним. Вот мой OnBeforePrint
событие:Как создать TfrxChartView в коде?
var
dsSections,
dsTests,
dsHistory: TfrxDataSet;
Chart: TfrxChartView;
ChartCount: Integer;
begin
dsSections := Report.GetDataSet('frdTestSections');
dsTests := Report.GetDataSet('frdResults');
dsHistory := Report.GetDataSet('frdTestHistory');
ChartCount := 0;
dsSections.First;
while not dsSections.Eof do
begin
dsTests.First;
while not dsTests.Eof do
begin
if dsHistory.RecordCount > 0 then
begin
Chart := TfrxChartView.Create(rsHistory);
Chart.Left := (ChartCount mod 2) * 8 + 1;
Chart.Top := (ChartCount div 2) * 5 + 0.5;
Chart.Width := 8;
Chart.Height := 5;
Chart.Chart.Title.Text.Text := dsTests.Value('Name');
Chart.Chart.View3D := False;
Chart.AddSeries(csLine);
dsHistory.First;
while not dsHistory.Eof do
begin
ShowMessage(dsTests.Value('Name') + #13#10 + IntToStr(dsHistory.RecNo + 1) + ' ' +dsHistory.Value('Result')); // this is for debugging only
Chart.Series[0].Add(dsHistory.Value('Result'), IntToStr(dsHistory.RecNo + 1), clBlue);
dsHistory.Next;
end;
Inc(ChartCount);
end;
dsTests.Next;
end;
dsSections.Next;
end;
end;
Что мне не хватает? Есть ли какое-либо свойство TfrxChartView
Я должен установить, что я омминг?