Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.10.27;
Скачать: CL | DM;

Вниз

Как распечатать несколько графиков (TChart) на одной странице?   Найти похожие ветки 

 
KIR ©   (2003-10-17 10:37) [0]

сабж


 
BOA_KAA ©   (2003-10-17 10:41) [1]

Отрисовать их на битмап и вручную...


 
KIR ©   (2003-10-17 10:45) [2]

Можно немного поподробнее (где хоть копать)? :)


 
Семен Сорокин ©   (2003-10-17 10:48) [3]

я делаю это так:

var
_i : TAllCharts; // всего чартов 1..5
_vc : TChart;
_size: integer;
_clr : TColor;
_bmp : TBitmap;
_top : integer;
_rect: TRect;
_info: PBitmapInfo;
_info_size, _img_size: cardinal;
_l, _t: integer;
_imgs: pointer;

...
Screen.Cursor := crHourGlass;
_bmp := TBitmap.Create;
try
_bmp.Width := pnlChartsNoScroll.Width;
_bmp.Height := pnlChartsNoScroll.Height+20;
_top := 0;
for _i := 1 to 5 do
if FPrintAllCharts[_i].Visible and (FPrintAllCharts[_i].SeriesCount > 0) then begin
if FPrintAllCharts[_i].Tag in [1..4] then
_size := FPrintAllCharts[_i].BottomAxis.LabelsSize;
_clr := FPrintAllCharts[_i].BottomAxis.LabelsFont.Color;
try
FPrintAllCharts[_i].Legend.Visible := true;
FPrintAllCharts[_i].Title.Visible := true;
FPrintAllCharts[_i].BottomAxis.LabelsSize := 0;
FPrintAllCharts[_i].BottomAxis.LabelsFont.Color := clBlack;
Application.ProcessMessages;
_rect := FPrintAllCharts[_i].Canvas.ReferenceCanvas.ClipRect;
_rect.Bottom := _rect.Bottom + _top;
_rect.Top := _rect.Top + _top;
_bmp.Canvas.CopyRect(_rect, FPrintAllCharts[_i].Canvas.ReferenceCanvas, FPrintAllCharts[_i].Canvas.ReferenceCanvas.ClipRect);
_top := _top + FPrintAllCharts[_i].Canvas.ReferenceCanvas.ClipRect.Bottom - FPrintAllCharts[_i].Canvas.ReferenceCanvas.ClipRect.Top + 5
finally
FPrintAllCharts[_i].Legend.Visible := false;
FPrintAllCharts[_i].Title.Visible := false;
FPrintAllCharts[_i].BottomAxis.LabelsSize := _size;
FPrintAllCharts[_i].BottomAxis.LabelsFont.Color := _clr
end
end;
Application.ProcessMessages;
_bmp.SaveToFile(GlobalSettings.OutDocDir + "\Parameters.bmp");
Printer.BeginDoc;
GetDIBSizes(_bmp.Handle, _info_size, _img_size);
_info := AllocMem(_info_size);
try
_imgs := AllocMem(_img_size);
try
GetDIB(_bmp.Handle, 0, _info^, _imgs^);
_l := Printer.PageWidth div 20;
_t := Printer.PageHeight div 20;
StretchDIBits(Printer.Canvas.Handle, _l, _t, Printer.PageWidth-_l*2, Printer.PageHeight-_t*2,
0, 0, _bmp.Width, _bmp.Height, _imgs, _info^, DIB_RGB_COLORS, SRCCOPY)
finally
FreeMem(_imgs, _img_size)
end
finally
FreeMem(_info, _info_size)
end;
Printer.EndDoc
finally
_bmp.Free;
Screen.Cursor := crDefault
end


FPrintAllCharts - массив чартов
pnlChartsNoScroll - панель, на которой лежат чарты



Страницы: 1 вся ветка

Текущий архив: 2003.10.27;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.022 c
3-89181
RealShip
2003-10-08 15:16
2003.10.27
Ошибка


14-89492
Мазут Береговой
2003-10-09 01:22
2003.10.27
Сегодня праздник! : Календарь рыболова: Сергии Радонежский


3-89150
Blondin
2003-10-06 20:40
2003.10.27
Редактируемые запросы в IBDataSet


1-89369
Piero
2003-10-15 20:32
2003.10.27
Непонятная ошибка компилятора


1-89335
killer
2003-10-16 12:52
2003.10.27
PopupMenu