Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2003.10.27;
Скачать: [xml.tar.bz2];

Вниз

Как распечатать несколько графиков (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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.01 c
1-89297
senya
2003-10-14 10:48
2003.10.27
PDF


3-89092
Vemer
2003-10-08 01:05
2003.10.27
Как запретить удаление строк по Ctrl+Del


1-89281
Dream
2003-10-14 10:40
2003.10.27
Как определить существует ли форма ?


3-89146
Vadim S
2003-10-07 12:40
2003.10.27
200 как отключить авто оптимизацию запроса?


3-89115
slavik
2003-10-08 16:08
2003.10.27
Ошибка открытия алиаса ACCESS97 под Win98





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский