ReportDlg.Tag:=Where;
j:=0;
n:=-1;
for i:=0 to Editor.ListBox1.Items.Count-1 do
//if TAbstractElement(Editor.ListBox1.Items.Objects[i]).flType then
if TAbstractElement(Editor.ListBox1.Items.Objects[i]).GraphFlag then
begin
st := TStaticText.CreateParented(0);
st.Left:=3;
st.AutoSize:= true;
st.Top:=17*j+2;
st.Caption:=Editor.ListBox1.Items.Strings[i];
st.ShowHint:=true;
st.Hint:=TAbstractElement(Editor.ListBox1.Items.Objects[i]).Image.Hint;
ReportDlg.ScrollBox1.InsertControl(st);
chart:=TAbstractMassa(Editor.ListBox1.Items.Objects[i]).GraphChart;
if chart<>nil then
for k:=1 to chart.SeriesCount do
begin
inc(n);
ch:= TCheckBox.CreateParented(0);
ch.Width:=17;
ch.Checked:=false;
ch.Top:=st.Top;
ch.Tag:=n;
ch.OnClick:=OnClickSeriesCheckBox;
ch.ShowHint:=true;
ch.Hint:=chart.Series[k-1].Title;
if chart.SeriesCount>1 then ch.Left:=64+24*k
else ch.Left:=64+24*3;
ReportDlg.ScrollBox1.InsertControl(ch);
ss:=ColorToString(ReportDlg.Chart1.GetFreeSeriesColor(true));
ser:=TLineSeries.Create(ReportDlg.Chart1);
ser.Active:=false;
ser.ShowInLegend:=false;
ser.Title:=chart.Series[k-1].Title+' ('+TAbstractElement(Editor.ListBox1.Items.Objects[i]).InputParamDlg.Caption+')';
{
case k of
1: if chart.SeriesCount>1 then ser.Title:='перемещение ('+TAbstractMassa(Editor.ListBox1.Items.Objects[i]).InputParamDlg.Caption+')'
else ser.Title:='сила ('+TAbstractElement(Editor.ListBox1.Items.Objects[i]).InputParamDlg.Caption+')';
2: ser.Title:='скорость ('+TAbstractElement(Editor.ListBox1.Items.Objects[i]).InputParamDlg.Caption+')';
3: ser.Title:='сила ('+TAbstractElement(Editor.ListBox1.Items.Objects[i]).InputParamDlg.Caption+')';
end; //case
}
ser.Title:=ser.Title+' (цвет - '+Copy(ss,3,length(ss)-2)+' )';
ser.AssignValues(chart.Series[k-1]);
ReportDlg.Chart1.AddSeries(Ser);
ch:=nil;
end;
st:=nil;
inc(j);
end;
Result:=ReportDlg.ShowModal;
ReportDlg.Destroy;
end;
end