• <menu id="w2i4a"></menu>
  • logo 【TeeChart Pro ActiveX教程】2018

    文檔首頁(yè)>>【TeeChart Pro ActiveX教程】2018>>【TeeChart Pro ActiveX教程】(十四):打印圖表

    【TeeChart Pro ActiveX教程】(十四):打印圖表


    下載TeeChart Pro ActiveX最新版本

    標(biāo)準(zhǔn)打印

    TeeChart Pro提供標(biāo)準(zhǔn)打印方法,可將“屏幕圖表”按原樣打印到打印機(jī)。

    簡(jiǎn)單打印命令

    要打印圖表,請(qǐng)使用Print方法。這將打印出屏幕上顯示的圖表:

    [C#]

    tChart1.Printer.Print(); 
    

    [VB.Net]

    TChart1.Printer.Print()
    

    打印方向

    Print方法允許您通過(guò)使用布爾橫向參數(shù)來(lái)打印橫向和縱向方向,即使它們未被定義為默認(rèn)方向。打印完成后,默認(rèn)方向?qū)⒃俅紊А?梢允褂肔andscape屬性更改默認(rèn)方向(對(duì)于Landscape,設(shè)置為true,對(duì)于Portrait,設(shè)置為false):

    [C#]

    tChart1.Printer.Landscape = true; 
    tChart1.Printer.Print();
    

    [VB.Net]

    TChart1.Printer.Landscape = True 
    TChart1.Printer.Print()
    

    打印預(yù)覽

    PrintPreview窗口將顯示打印時(shí)圖表的顯示方式。您可以在“打印預(yù)覽”窗口中修改打印參數(shù)。要調(diào)用PrintPreview運(yùn)行:

    [C#]

    tChart1.Printer.Preview(); 
    
    

    [VB.Net]

    TChart1.Printer.Preview()
    
    

    灰度打印

    當(dāng)打印到Greyscale打印機(jī)時(shí),您應(yīng)該注意圖表的顏色在轉(zhuǎn)換為灰色陰影時(shí)很容易區(qū)分。為了提供幫助,您可以在圖表系列中添加畫筆樣式,以便在打印時(shí)更輕松地區(qū)分系列。

    您還可以使用灰度屬性將彩色圖表打印到彩色打印機(jī):

    [C#]

    tChart1.Printer.Grayscale = true; 
    tChart1.Printer.Print(true); 
    

    [VB.Net]

    TChart1.Printer.Grayscale = True 
    TChart1.Printer.Print(True) 
    

    擴(kuò)展打印方法

    打印多個(gè)圖表

    使用BeginPrint()和EndPrint()將圖表發(fā)送到打印機(jī)而不彈出頁(yè)面; BeginPrint()和EndPrint()開(kāi)始和結(jié)束打印機(jī)作業(yè)??梢詫⒍鄠€(gè)圖表發(fā)送到同一頁(yè)面/打印機(jī)作業(yè),也可以包含用戶自定義輸入。

    (將2個(gè)圖表打印到頁(yè)面)

    [C#]

    private void button1_Click(object sender, System.EventArgs e) { 
            tChart1.Printer.BeginPrint(); 
            tChart1.Printer.Print(tChart2.Chart,new Rectangle(100,10,300,200)); 
            tChart1.Printer.Print(new Rectangle(100,300,300,200)); 
            tChart1.Printer.EndPrint(); 
    } 
    

    [VB.Net]

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
            TChart1.Printer.BeginPrint() 
            TChart1.Printer.Print(TChart2.Chart, New Rectangle(100, 10, 300, 200)) 
            TChart1.Printer.Print(New Rectangle(100, 300, 300, 200)) 
            TChart1.Printer.EndPrint() 
    End Sub 
    

    在一個(gè)頁(yè)面上打印預(yù)覽多個(gè)圖表

    打印預(yù)覽器現(xiàn)在可以接受多個(gè)圖表??刂茍D表位置設(shè)置Print方法的Rectangle。

    (在打印預(yù)覽器中顯示2個(gè)圖表)

    [C#]

    private void button1_Click(object sender, System.EventArgs e) { 
            tChart1.Printer.BeginPrint(); 
            tChart1.Printer.Print(tChart2.Chart,new Rectangle(100,10,300,200)); 
            tChart1.Printer.Print(new Rectangle(100,300,300,200)); 
            tChart1.Printer.Preview(); 
    } 
    

    [VB.Net]

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
            TChart1.Printer.BeginPrint() 
            TChart1.Printer.Print(TChart2.Chart, New Rectangle(100, 10, 300, 200)) 
            TChart1.Printer.Print(New Rectangle(100, 300, 300, 200)) 
            TChart1.Printer.Preview() 
    End Sub 
    

    將打印的圖表輸出與其他打印輸出混合

    使用ChartPrint()事件將TeeChart打印輸出與非Chart打印機(jī)輸出混合。 以下示例從TeeChart標(biāo)題中獲取文本,并在具有兩個(gè)TChart對(duì)象的頁(yè)面上打印它們:

    [C#]

    private void button1_Click(object sender, System.EventArgs e) { 
            tChart1.Printer.BeginPrint(); 
            tChart1.Printer.Print(tChart2.Chart,new Rectangle(100,10,300,200)); 
            tChart1.Printer.Print(new Rectangle(100,300,300,200)); 
            tChart1.Printer.EndPrint(); 
    } 
     
    private void tChart1_ChartPrint(object sender, System.Drawing.Printing.PrintPageEventArgs e) { 
            e.Graphics.DrawString("Chart: "+((Steema.TeeChart.ChartPrintJob)sender).Chart.Header.Text, 
                this.Font,new SolidBrush(Color.Black),100,((Steema.TeeChart.ChartPrintJob)sender).ChartRect.Bottom+10); 
    } 
    

    [VB.Net]

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
            TChart1.Printer.BeginPrint() 
            TChart1.Printer.Print(TChart2.Chart, New Rectangle(100, 10, 300, 200)) 
            TChart1.Printer.Print(New Rectangle(100, 300, 300, 200)) 
            TChart1.Printer.EndPrint() 
    End Sub 
     
    Private Sub TChart1_ChartPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles TChart1.ChartPrint 
            e.Graphics.DrawString("Chart: " & (CType(sender, Steema.TeeChart.ChartPrintJob)).Chart.Header.Text, _ 
            Me.Font, New SolidBrush(Color.Black), 100, (CType(sender, Steema.TeeChart.ChartPrintJob)).ChartRect.Bottom + 10) 
    End Sub 
    

    購(gòu)買TeeChart Pro AciveX正版授權(quán),請(qǐng)點(diǎn)擊“咨詢?cè)诰€客服”喲!

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();