Class Chart

Class Chart

Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)

ห่อหุ้มวัตถุที่แทนกราฟ Excel เดียว

public class Chart

การสืบทอด

objectChart

สมาชิกที่สืบทอด

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

ตัวอย่าง

โค้ดต่อไปนี้แสดงวิธีการสร้างกราฟด้วยโค้ด .Net

Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

Cells cells = sheet.Cells;
cells[0,1].PutValue("รายได้");
cells[1,0].PutValue("บริษัท A");
cells[2,0].PutValue("บริษัท B");
cells[3,0].PutValue("บริษัท C");
cells[1,1].PutValue(10000);
cells[2,1].PutValue(20000);
cells[3,1].PutValue(30000);

int chartIndex = sheet.Charts.Add(ChartType.Column, 9, 9, 21, 15);

Chart chart = sheet.Charts[chartIndex];
chart.SetChartDataRange("A1:B4", true);
chart.ShowLegend = true;
chart.Title.Text = "การวิเคราะห์รายได้";
Dim workbook as Workbook = new Workbook()
Dim sheet as Worksheet = workbook.Worksheets(0)

Dim cells as Cells = sheet.Cells
cells(0,1).PutValue("รายได้")
cells(1,0).PutValue("บริษัท A")
cells(2,0).PutValue("บริษัท B")
cells(3,0).PutValue("บริษัท C")
cells(1,1).PutValue(10000)
cells(2,1).PutValue(20000)
cells(3,1).PutValue(30000)

Dim chartIndex as Integer = sheet.Charts.Add(ChartType.Column, 9, 9, 21, 15)

Dim chart as Chart = sheet.Charts(chartIndex) 
chart.SetChartDataRange("A1:B4", True);
chart.ShowLegend = True
chart.Title.Text = "การวิเคราะห์รายได้"

คุณสมบัติ

ActualChartSize

รับขนาดจริงของกราฟในหน่วยพิกเซล

[Obsolete("ใช้ Chart.GetActualSize() แทน.")]
public Size ActualChartSize { get; }

ค่า Property

Size

หมายเหตุ

หมายเหตุ: สมาชิกนี้หมดอายุแล้ว โปรดใช้ Chart.GetActualSize() แทน คุณสมบัตินี้จะถูกลบในอีก 12 เดือนนับจากเดือนกรกฎาคม 2022 Aspose ขออภัยในความไม่สะดวกที่เกิดขึ้น

AutoScaling

เป็นจริงหาก Microsoft Excel ปรับขนาดกราฟ 3-D เพื่อให้ใกล้เคียงกับขนาดของกราฟ 2-D ที่เทียบเท่า คุณสมบัติ RightAngleAxes ต้องเป็นจริง

public bool AutoScaling { get; set; }

ค่า Property

bool

BackWall

ส่งคืนวัตถุ Aspose.Cells.Charts.Chart.Walls ที่แทนผนังด้านหลังของกราฟ 3-D

public Walls BackWall { get; }

ค่า Property

Walls

CategoryAxis

รับแกน X ของกราฟ

public Axis CategoryAxis { get; }

ค่า Property

Axis

ChartArea

รับพื้นที่กราฟในแผ่นงาน

public ChartArea ChartArea { get; }

ค่า Property

ChartArea

ChartDataTable

แทนตารางข้อมูลกราฟ

public ChartDataTable ChartDataTable { get; }

ค่า Property

ChartDataTable

ChartObject

แทน ChartShape;

public ChartShape ChartObject { get; }

ค่า Property

ChartShape

DepthPercent

แทนความลึกของกราฟ 3-D เป็นเปอร์เซ็นต์ของความกว้างของกราฟ (ระหว่าง 20 ถึง 2000 เปอร์เซ็นต์)

public int DepthPercent { get; set; }

ค่า Property

int

DisplayNaAsBlank

ระบุว่าจะแสดง #N/A เป็นค่าที่ว่างหรือไม่

public bool DisplayNaAsBlank { get; set; }

ค่า Property

bool

Elevation

แทนการยกของมุมมองกราฟ 3-D ในองศา

public int Elevation { get; set; }

ค่า Property

int

หมายเหตุ

การยกกราฟคือความสูงที่คุณดูกราฟในองศา ค่าปกติคือ 15 สำหรับประเภทกราฟส่วนใหญ่ ค่าของคุณสมบัตินี้ต้องอยู่ระหว่าง -90 ถึง 90 ยกเว้นกราฟแท่ง 3-D ซึ่งต้องอยู่ระหว่าง 0 ถึง 44

FilteredNSeries

รับคอลเล็กชัน Aspose.Cells.Charts.SeriesCollection ที่แทนชุดข้อมูลที่ถูกกรองในกราฟ

public SeriesCollection FilteredNSeries { get; }

ค่า Property

SeriesCollection

FirstSliceAngle

รับหรือกำหนดมุมของชิ้นส่วนแรกของกราฟวงกลมหรือกราฟโดนัทในองศา (ตามเข็มนาฬิกาจากแนวตั้ง) ใช้ได้เฉพาะกับกราฟวงกลม, กราฟวงกลม 3-D และกราฟโดนัท, 0 ถึง 360

public int FirstSliceAngle { get; set; }

ค่า Property

int

Floor

ส่งคืนวัตถุ Aspose.Cells.Charts.Chart.Floor ที่แทนผนังของกราฟ 3-D

public Floor Floor { get; }

ค่า Property

Floor

หมายเหตุ

คุณสมบัตินี้ใช้ไม่ได้กับกราฟวงกลม 3-D

GapDepth

รับหรือกำหนดระยะห่างระหว่างชุดข้อมูลในกราฟ 3-D เป็นเปอร์เซ็นต์ของความกว้างของตัวชี้ ค่าของคุณสมบัตินี้ต้องอยู่ระหว่าง 0 ถึง 500

public int GapDepth { get; set; }

ค่า Property

int

GapWidth

รับหรือกำหนดระยะห่างระหว่างกลุ่มแท่งหรือคอลัมน์เป็นเปอร์เซ็นต์ของความกว้างของแท่งหรือคอลัมน์ ค่าของคุณสมบัตินี้ต้องอยู่ระหว่าง 0 ถึง 500

public int GapWidth { get; set; }

ค่า Property

int

HeightPercent

รับหรือกำหนดความสูงของกราฟ 3-D เป็นเปอร์เซ็นต์ของความกว้างของกราฟ (ระหว่าง 5 ถึง 500 เปอร์เซ็นต์)

public int HeightPercent { get; set; }

ค่า Property

int

HidePivotFieldButtons

ระบุว่าจะแสดงปุ่มฟิลด์พีวอตกราฟเฉพาะเมื่อกราฟเป็น PivotChart หรือไม่

public bool HidePivotFieldButtons { get; set; }

ค่า Property

bool

Is3D

ระบุว่ากราฟเป็นกราฟ 3D หรือไม่

public bool Is3D { get; }

ค่า Property

bool

IsRectangularCornered

รับหรือกำหนดค่าเพื่อระบุว่าพื้นที่กราฟมีมุมเป็นสี่เหลี่ยมผืนผ้าหรือไม่ ค่าปกติคือจริง

public bool IsRectangularCornered { get; set; }

ค่า Property

bool

Legend

รับตำนานของกราฟ

public Legend Legend { get; }

ค่า Property

Legend

Line

รับเส้น

public Line Line { get; }

ค่า Property

Line

NSeries

รับคอลเล็กชัน Aspose.Cells.Charts.SeriesCollection ที่แทนชุดข้อมูลในกราฟ

public SeriesCollection NSeries { get; }

ค่า Property

SeriesCollection

Name

รับและกำหนดชื่อของกราฟ

public string Name { get; set; }

ค่า Property

string

PageSetup

แทนคำอธิบายการตั้งค่าหน้าในกราฟนี้

public PageSetup PageSetup { get; }

ค่า Property

PageSetup

Perspective

รับหรือกำหนดมุมมองสำหรับกราฟ 3-D ต้องอยู่ระหว่าง 0 ถึง 100 คุณสมบัตินี้จะถูกละเว้นหากคุณสมบัติ RightAngleAxes เป็นจริง

public short Perspective { get; set; }

ค่า Property

short

PivotOptions

ระบุการควบคุมพีวอตที่ปรากฏในกราฟ

public PivotOptions PivotOptions { get; }

ค่า Property

PivotOptions

PivotSource

แหล่งข้อมูลคือข้อมูลของ pivotTable หาก PivotSource ไม่ว่างเปล่ากราฟจะเป็น PivotChart

public string PivotSource { get; set; }

ค่า Property

string

หมายเหตุ

หากตารางพีวอต “PivotTable1” ในแผ่นงาน “Sheet1” ในไฟล์ “Book1.xls” PivotSource อาจเป็น “[Book1.xls]Sheet1!PivotTable1” หากกราฟและ PivotTable ไม่อยู่ในสมุดงานเดียวกัน หากคุณตั้งค่าคุณสมบัตินี้การตั้งค่าแหล่งข้อมูลก่อนหน้าจะหายไป

Placement

แทนวิธีที่กราฟเชื่อมต่อกับเซลล์ด้านล่าง

public PlacementType Placement { get; set; }

ค่า Property

PlacementType

PlotArea

รับพื้นที่การวาดของกราฟซึ่งรวมถึงฉลากแกน

public PlotArea PlotArea { get; }

ค่า Property

PlotArea

PlotBy

รับและกำหนดว่าจะวาดตามแถวหรือคอลัมน์

public PlotDataByType PlotBy { get; }

ค่า Property

PlotDataByType

PlotEmptyCellsType

รับและกำหนดวิธีการวาดเซลล์ว่าง

public PlotEmptyCellsType PlotEmptyCellsType { get; set; }

ค่า Property

PlotEmptyCellsType

PlotVisibleCellsOnly

ระบุว่าจะแสดงเฉพาะเซลล์ที่มองเห็นได้หรือไม่

public bool PlotVisibleCellsOnly { get; set; }

ค่า Property

bool

PrintSize

รับและกำหนดขนาดกราฟที่พิมพ์

public PrintSizeType PrintSize { get; set; }

ค่า Property

PrintSizeType

RightAngleAxes

เป็นจริงหากแกนกราฟอยู่ที่มุมฉาก ใช้ได้เฉพาะสำหรับกราฟ 3-D (ยกเว้นกราฟ Column3D และกราฟวงกลม 3-D)

public bool RightAngleAxes { get; set; }

ค่า Property

bool

หมายเหตุ

หากคุณสมบัตินี้เป็นจริงคุณสมบัติ Perspective จะถูกละเว้น

RotationAngle

แทนการหมุนของมุมมองกราฟ 3-D (การหมุนของพื้นที่การวาดรอบแกน z ในองศา)

public int RotationAngle { get; set; }

ค่า Property

int

หมายเหตุ

ค่าของคุณสมบัตินี้ต้องอยู่ระหว่าง 0 ถึง 360 ยกเว้นกราฟแท่ง 3-D ซึ่งค่าต้องอยู่ระหว่าง 0 ถึง 44 ค่าปกติคือ 20 ใช้ได้เฉพาะกับกราฟ 3-D

SecondCategoryAxis

รับแกน X ที่สองของกราฟ

public Axis SecondCategoryAxis { get; }

ค่า Property

Axis

SecondValueAxis

รับแกน Y ที่สองของกราฟ

public Axis SecondValueAxis { get; }

ค่า Property

Axis

SeriesAxis

รับแกนชุดข้อมูลของกราฟ

public Axis SeriesAxis { get; }

ค่า Property

Axis

Shapes

ส่งคืนรูปวาดทั้งหมดในกราฟนี้

public ShapeCollection Shapes { get; }

ค่า Property

ShapeCollection

ShowDataTable

รับหรือกำหนดค่าเพื่อระบุว่ากราฟจะแสดงตารางข้อมูลหรือไม่

public bool ShowDataTable { get; set; }

ค่า Property

bool

ShowLegend

รับหรือกำหนดค่าเพื่อระบุว่าตำนานกราฟจะแสดงหรือไม่ ค่าปกติคือจริง

public bool ShowLegend { get; set; }

ค่า Property

bool

SideWall

ส่งคืนวัตถุ Aspose.Cells.Charts.Chart.Walls ที่แทนผนังด้านข้างของกราฟ 3-D

public Walls SideWall { get; }

ค่า Property

Walls

SizeWithWindow

เป็นจริงหาก Microsoft Excel ปรับขนาดกราฟให้ตรงกับขนาดของหน้าต่างแผ่นกราฟ

public bool SizeWithWindow { get; set; }

ค่า Property

bool

Style

รับและกำหนดสไตล์ที่สร้างไว้ล่วงหน้า

public int Style { get; set; }

ค่า Property

int

หมายเหตุ

ควรอยู่ระหว่าง 1 ถึง 48 คืนค่า -1 หากไม่ได้ตั้งค่า

SubTitle

รับซับไตเติ้ลของกราฟ ใช้ได้เฉพาะกับไฟล์รูปแบบ ODS

public Title SubTitle { get; }

ค่า Property

Title

Title

รับชื่อของกราฟ

public Title Title { get; }

ค่า Property

Title

Type

รับหรือกำหนดประเภทของกราฟ

public ChartType Type { get; set; }

ค่า Property

ChartType

ValueAxis

รับแกน Y ของกราฟ

public Axis ValueAxis { get; }

ค่า Property

Axis

Walls

ส่งคืนวัตถุ Aspose.Cells.Charts.Chart.Walls ที่แทนผนังของกราฟ 3-D

public Walls Walls { get; }

ค่า Property

Walls

หมายเหตุ

คุณสมบัตินี้ใช้ไม่ได้กับกราฟวงกลม 3-D

WallsAndGridlines2D

เป็นจริงหากเส้นกริดถูกวาดในสองมิติบนกราฟ 3-D

public bool WallsAndGridlines2D { get; set; }

ค่า Property

bool

Worksheet

รับแผ่นงานที่มีกราฟนี้

public Worksheet Worksheet { get; }

ค่า Property

Worksheet

วิธีการ

Calculate()

คำนวณตำแหน่งที่กำหนดเองของพื้นที่การวาด, แกนหากตำแหน่งของมันถูกกำหนดโดยอัตโนมัติ

public void Calculate()

Calculate(ChartCalculateOptions)

คำนวณตำแหน่งที่กำหนดเองของพื้นที่การวาด, แกนหากตำแหน่งของมันถูกกำหนดโดยอัตโนมัติ พร้อมกับตัวเลือกการคำนวณกราฟ

public void Calculate(ChartCalculateOptions calculateOptions)

พารามิเตอร์

calculateOptions ChartCalculateOptions

ChangeTemplate(byte[])

เปลี่ยนประเภทกราฟด้วยเทมเพลตที่ตั้งไว้ล่วงหน้า

public void ChangeTemplate(byte[] data)

พารามิเตอร์

data byte[]

ข้อมูลของไฟล์เทมเพลตกราฟ(.crtx)

GetActualSize()

รับขนาดจริงของกราฟในหน่วยพิกเซล

public int[] GetActualSize()

คืนค่า

int[]

ขนาดจริงในอาร์เรย์ (ความกว้างและความสูง) [0] คือความกว้าง; [1] คือความสูง

GetChartDataRange()

รับช่วงแหล่งข้อมูลของกราฟ

public string GetChartDataRange()

คืนค่า

string

แหล่งข้อมูล

หมายเหตุ

รองรับเฉพาะช่วง

HasAxis(AxisType, bool)

ส่งคืนแกนที่มีอยู่ในกราฟ

public bool HasAxis(AxisType aixsType, bool isPrimary)

พารามิเตอร์

aixsType AxisType

isPrimary bool

คืนค่า

bool

หมายเหตุ

โดยปกติแล้ว, Pie, PieExploded, PiePie,PieBar, Pie3D, Pie3DExploded,Doughnut, DoughnutExploded ไม่มีแกน

IsCellReferedByChart(int, int, int)

ส่งคืนว่ามีเซลล์ที่อ้างถึงโดยกราฟหรือไม่

public bool IsCellReferedByChart(int sheetIndex, int rowIndex, int columnIndex)

พารามิเตอร์

sheetIndex int

ดัชนีแผ่นงาน -1 หมายถึงแผ่นงานที่มีกราฟปัจจุบัน

rowIndex int

ดัชนีแถว

columnIndex int

ดัชนีคอลัมน์

คืนค่า

bool

IsChartDataChanged()

ตรวจสอบว่าข้อมูลแหล่งของกราฟมีการเปลี่ยนแปลงหรือไม่

public bool IsChartDataChanged()

คืนค่า

bool

คืนค่าจริงหากกราฟมีการเปลี่ยนแปลงมิฉะนั้นคืนค่าเท็จ

หมายเหตุ

วิธีนี้ตรวจจับการเปลี่ยนแปลงในแหล่งข้อมูลของกราฟก่อนที่จะเรนเดอร์กราฟเป็นรูปแบบภาพ ในครั้งแรกที่เรียก Chart.toImage ข้อมูลแหล่งที่มาของกราฟ (เช่น XValuesParseData, ValuesParseData) จะถูกบันทึก ก่อนเรียกใช้วิธี Chart.toImage อีกครั้งให้เรียกใช้วิธี IsChartDataChanged เพื่อตรวจสอบว่ากราฟต้องการการเรนเดอร์ใหม่หรือไม่

Move(int, int, int, int)

ย้ายกราฟไปยังตำแหน่งที่กำหนด

public void Move(int upperLeftRow, int upperLeftColumn, int lowerRightRow, int lowerRightColumn)

พารามิเตอร์

upperLeftRow int

ดัชนีแถวด้านซ้ายบน

upperLeftColumn int

ดัชนีคอลัมน์ด้านซ้ายบน

lowerRightRow int

ดัชนีแถวด้านล่างขวา

lowerRightColumn int

ดัชนีคอลัมน์ด้านล่างขวา

RefreshPivotData()

รีเฟรชข้อมูลของกราฟจากตารางพีวอต

public void RefreshPivotData()

หมายเหตุ

เราจะรวบรวมข้อมูลจากแหล่งข้อมูลพีวอตไปยังรายงานตารางพีวอต วิธีนี้ใช้เฉพาะเพื่อรวบรวมข้อมูลทั้งหมดไปยังกราฟพีวอต

SetChartDataRange(string, bool)

ระบุช่วงข้อมูลสำหรับกราฟ

public void SetChartDataRange(string area, bool isVertical)

พารามิเตอร์

area string

ระบุค่าจากซึ่งจะวาดชุดข้อมูล

isVertical bool

ระบุว่าจะแสดงชุดข้อมูลจากช่วงค่าของเซลล์ตามแถวหรือคอลัมน์

SwitchRowColumn()

สลับแถว/คอลัมน์

public bool SwitchRowColumn()

คืนค่า

bool

เท็จหมายถึงการสลับแถว/คอลัมน์ล้มเหลว

ToImage(string)

สร้างภาพกราฟและบันทึกลงไฟล์ นามสกุลของชื่อไฟล์กำหนดรูปแบบของภาพ

public void ToImage(string imageFile)

พารามิเตอร์

imageFile string

ชื่อไฟล์ภาพพร้อมเส้นทางเต็ม

หมายเหตุ

รูปแบบของภาพกำหนดโดยใช้ส่วนขยายของชื่อไฟล์ ตัวอย่างเช่น หากคุณระบุ "myfile.png" ภาพจะถูกบันทึก ในรูปแบบ PNG ส่วนขยายไฟล์ต่อไปนี้ได้รับการยอมรับ: .bmp, .gif, .png, .jpg, .jpeg, .tiff, .tif, .emf.

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย

ToImage(string, ImageType)

สร้างภาพกราฟและบันทึกลงไฟล์ในประเภทภาพที่กำหนด

public void ToImage(string imageFile, ImageType imageType)

พารามิเตอร์

imageFile string

ชื่อไฟล์ภาพพร้อมเส้นทางเต็ม

imageType ImageType

ประเภทภาพที่ใช้ในการบันทึกภาพ

หมายเหตุ

ประเภทของภาพกำหนดโดยใช้ `imageType` ประเภทต่อไปนี้ได้รับการสนับสนุน: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย

ToImage(string, long)

สร้างภาพกราฟและบันทึกลงไฟล์ในรูปแบบ Jpeg

public void ToImage(string imageFile, long jpegQuality)

พารามิเตอร์

imageFile string

ชื่อไฟล์ภาพพร้อมเส้นทางเต็ม

jpegQuality long

คุณภาพ Jpeg

หมายเหตุ

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย

ToImage(Stream, long)

สร้างภาพกราฟและบันทึกลงสตรีมในรูปแบบ Jpeg

public void ToImage(Stream stream, long jpegQuality)

พารามิเตอร์

stream Stream

สตรีมเอาต์พุต

jpegQuality long

คุณภาพ Jpeg

หมายเหตุ

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย

ToImage(Stream, ImageType)

สร้างภาพกราฟและบันทึกลงสตรีมในรูปแบบที่กำหนด

public void ToImage(Stream stream, ImageType imageType)

พารามิเตอร์

stream Stream

สตรีมเอาต์พุต

imageType ImageType

ประเภทภาพที่ใช้ในการบันทึกภาพ

หมายเหตุ

ประเภทของภาพกำหนดโดยใช้ `imageType` รูปแบบต่อไปนี้ได้รับการสนับสนุน: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย

ToImage(string, ImageOrPrintOptions)

สร้างภาพกราฟและบันทึกลงไฟล์ นามสกุลของชื่อไฟล์กำหนดรูปแบบของภาพ

public void ToImage(string imageFile, ImageOrPrintOptions options)

พารามิเตอร์

imageFile string

ชื่อไฟล์ภาพพร้อมเส้นทางเต็ม

options ImageOrPrintOptions

ตัวเลือกการสร้างภาพเพิ่มเติม

ตัวอย่าง

บันทึกเป็น Tiff ด้วยความละเอียด 300 dpi และการบีบอัด CCITT4

ImageOrPrintOptions options = new ImageOrPrintOptions();
options.HorizontalResolution = 300;
options.VerticalResolution = 300;
options.TiffCompression = TiffCompression.CompressionCCITT4;

Workbook book = new Workbook(@"test.xls");
book.Worksheets[0].Charts[0].ToImage(@"chart.Tiff", options);

[VB]
Dim options As ImageOrPrintOptions =  New ImageOrPrintOptions() 
options.HorizontalResolution = 300
options.VerticalResolution = 300
options.TiffCompression = TiffCompression.CompressionCCITT4

Dim book As Workbook =  New Workbook("test.xls")
book.Worksheets(0).Charts(0).ToImage("chart.Tiff", options)

บันทึกเป็น Jpeg ด้วยความละเอียด 300 dpi และคุณภาพภาพ 80

ImageOrPrintOptions options = new ImageOrPrintOptions();
options.HorizontalResolution = 300;
options.VerticalResolution = 300;
options.Quality = 80;

Workbook book = new Workbook(@"test.xls");
book.Worksheets[0].Charts[0].ToImage(@"chart.Jpeg", options);

[VB]
Dim options As ImageOrPrintOptions =  New ImageOrPrintOptions()
options.HorizontalResolution = 300
options.VerticalResolution = 300
options.Quality = 80

Dim book As Workbook =  New Workbook("test.xls")
book.Worksheets(0).Charts(0).ToImage("chart.Jpeg", options)

หมายเหตุ

รูปแบบของภาพกำหนดโดยใช้ส่วนขยายของชื่อไฟล์ ตัวอย่างเช่น หากคุณระบุ "myfile.png" ภาพจะถูกบันทึก ในรูปแบบ PNG ส่วนขยายไฟล์ต่อไปนี้ได้รับการยอมรับ: .bmp, .gif, .png, .jpg, .jpeg, .tiff, .tif, .emf.

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย โปรดดู รายการกราฟที่สนับสนุน สำหรับรายละเอียดเพิ่มเติม

ToImage(Stream, ImageOrPrintOptions)

สร้างภาพกราฟและบันทึกลงสตรีมในรูปแบบที่กำหนด

public void ToImage(Stream stream, ImageOrPrintOptions options)

พารามิเตอร์

stream Stream

สตรีมเอาต์พุต

options ImageOrPrintOptions

ตัวเลือกการสร้างภาพเพิ่มเติม

หมายเหตุ

ประเภทของภาพกำหนดโดยใช้ `options.ImageType` รูปแบบต่อไปนี้ได้รับการสนับสนุน: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

หากความกว้างหรือความสูงเป็นศูนย์หรือกราฟไม่สนับสนุนตามรายการกราฟที่สนับสนุนวิธีนี้จะไม่ทำอะไรเลย โปรดดู รายการกราฟที่สนับสนุน สำหรับรายละเอียดเพิ่มเติม

ToPdf(string)

บันทึกกราฟลงในไฟล์ pdf

public void ToPdf(string fileName)

พารามิเตอร์

fileName string

ชื่อไฟล์ pdf พร้อมเส้นทางเต็ม

ToPdf(string, float, float, PageLayoutAlignmentType, PageLayoutAlignmentType)

บันทึกกราฟลงในไฟล์ pdf

public void ToPdf(string fileName, float desiredPageWidth, float desiredPageHeight, PageLayoutAlignmentType hAlignmentType, PageLayoutAlignmentType vAlignmentType)

พารามิเตอร์

fileName string

ชื่อไฟล์ pdf พร้อมเส้นทางเต็ม

desiredPageWidth float

ความกว้างหน้าที่ต้องการเป็นนิ้ว

desiredPageHeight float

ความสูงหน้าที่ต้องการเป็นนิ้ว

hAlignmentType PageLayoutAlignmentType

ประเภทการจัดแนวนอนของกราฟในหน้าที่ส่งออก

vAlignmentType PageLayoutAlignmentType

ประเภทการจัดแนวตั้งของกราฟในหน้าที่ส่งออก

ToPdf(Stream)

สร้าง pdf ของกราฟและบันทึกลงในสตรีม

public void ToPdf(Stream stream)

พารามิเตอร์

stream Stream

สตรีมเอาต์พุต

ToPdf(Stream, float, float, PageLayoutAlignmentType, PageLayoutAlignmentType)

สร้าง pdf ของกราฟและบันทึกลงในสตรีม

public void ToPdf(Stream stream, float desiredPageWidth, float desiredPageHeight, PageLayoutAlignmentType hAlignmentType, PageLayoutAlignmentType vAlignmentType)

พารามิเตอร์

stream Stream

สตรีมเอาต์พุต

desiredPageWidth float

ความกว้างหน้าที่ต้องการเป็นนิ้ว

desiredPageHeight float

ความสูงหน้าที่ต้องการเป็นนิ้ว

hAlignmentType PageLayoutAlignmentType

ประเภทการจัดแนวนอนของกราฟในหน้าที่ส่งออก

vAlignmentType PageLayoutAlignmentType

ประเภทการจัดแนวตั้งของกราฟในหน้าที่ส่งออก

 แบบไทย