unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  TeEngine, Series, ExtCtrls, TeeProcs, Chart, TeeFunci, PtblRV,
  RVStyle, RVScroll, RichView, StdCtrls,
  ChartItem;

type
  TForm1 = class(TForm)
    Chart1: TChart;
    Series1: TPieSeries;
    TeeFunction1: TAverageTeeFunction;
    RichView1: TRichView;
    RVStyle1: TRVStyle;
    RVPrint1: TRVPrint;
    Button1: TButton;
    Chart2: TChart;
    Series2: THorizBarSeries;
    Series3: THorizBarSeries;
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var item: TRVChartItemInfo;
begin
  // Filling charts
  Chart1.Series[0].Add(1,'1',clTeeColor);
  Chart1.Series[0].Add(2,'2',clTeeColor);
  Chart1.Series[0].Add(3,'3',clTeeColor);
  Chart1.Series[0].Add(4,'4',clTeeColor);

  Chart2.Series[0].Add(1,'1',clTeeColor);
  Chart2.Series[0].Add(2,'2',clTeeColor);
  Chart2.Series[0].Add(3,'3',clTeeColor);
  Chart2.Series[0].Add(4,'4',clTeeColor);
  Chart2.Series[1].Add(4,'4',clTeeColor);
  Chart2.Series[1].Add(3,'3',clTeeColor);
  Chart2.Series[1].Add(2,'2',clTeeColor);
  Chart2.Series[1].Add(1,'1',clTeeColor);



  RichView1.AddNL('Printing example',1,1);
  RichView1.AddBreak;

  item := TRVChartItemInfo.CreateEx(RichView1.RVData, Chart1, rvvaBaseline);
  item.ParaNo := 1;
  RichView1.AddItem('',item);

    RichView1.AddBreak;

  item := TRVChartItemInfo.CreateEx(RichView1.RVData, Chart2, rvvaBaseline);
  item.ParaNo := 1;
  RichView1.AddItem('',item);
  RichView1.AddBreak;
  RichView1.AddNL('END OF DOC',0,0);


  RichView1.Format;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  RVPrint1.AssignSource(RichView1);
  RVPrint1.FormatPages(rvdoAll) ;
  RVPrint1.Print('Chart',1,False) ;
end;

end.
