Class ChartDataTable

Class ChartDataTable

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

แทนตารางข้อมูลของแผนภูมิ

public class ChartDataTable

การสืบทอด

objectChartDataTable

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

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

ตัวอย่าง


//การสร้างอ็อบเจ็กต์ Workbook
Workbook workbook = new Workbook();

//การเข้าถึงอ้างอิงของแผ่นงานแรก
Worksheet worksheet = workbook.Worksheets[0];

//การเพิ่มค่าตัวอย่างไปยังเซลล์ "A1"
worksheet.Cells["A1"].PutValue(50);

//การเพิ่มค่าตัวอย่างไปยังเซลล์ "A2"
worksheet.Cells["A2"].PutValue(100);

//การเพิ่มค่าตัวอย่างไปยังเซลล์ "A3"
worksheet.Cells["A3"].PutValue(150);

//การเพิ่มค่าตัวอย่างไปยังเซลล์ "B1"
worksheet.Cells["B1"].PutValue(60);

//การเพิ่มค่าตัวอย่างไปยังเซลล์ "B2"
worksheet.Cells["B2"].PutValue(32);

//การเพิ่มค่าตัวอย่างไปยังเซลล์ "B3"
worksheet.Cells["B3"].PutValue(50);

//การเพิ่มแผนภูมิไปยังแผ่นงาน
int chartIndex = worksheet.Charts.Add(ChartType.Column, 5, 0, 25, 10);

//การเข้าถึงอ็อบเจ็กต์ของแผนภูมิที่เพิ่งเพิ่ม
Chart chart = worksheet.Charts[chartIndex];

//การเพิ่ม NSeries (แหล่งข้อมูลแผนภูมิ) ไปยังแผนภูมิที่มีช่วงจากเซลล์ "A1" ถึง "B3"
chart.NSeries.Add("A1:B3", true);

chart.ShowDataTable = true;

//การรับตารางแผนภูมิ
ChartDataTable chartTable = chart.ChartDataTable;

//การตั้งค่าสีฟอนต์ของตารางแผนภูมิ
chartTable.Font.Color = System.Drawing.Color.Red;

//การตั้งค่าการมองเห็นของกุญแจในตำนาน
chartTable.ShowLegendKey = false;

//การบันทึกไฟล์ Excel
workbook.Save("book1.xls");

'การสร้างอ็อบเจ็กต์ Workbook
Dim workbook As Workbook = New Workbook()

'การเข้าถึงอ้างอิงของแผ่นงานแรก
Dim worksheet As Worksheet = workbook.Worksheets(0)

'การเพิ่มค่าตัวอย่างไปยังเซลล์ "A1"
worksheet.Cells("A1").PutValue(50)

'การเพิ่มค่าตัวอย่างไปยังเซลล์ "A2"
worksheet.Cells("A2").PutValue(100)

'การเพิ่มค่าตัวอย่างไปยังเซลล์ "A3"
worksheet.Cells("A3").PutValue(150)

'การเพิ่มค่าตัวอย่างไปยังเซลล์ "B1"
worksheet.Cells("B1").PutValue(60)

'การเพิ่มค่าตัวอย่างไปยังเซลล์ "B2"
worksheet.Cells("B2").PutValue(32)

'การเพิ่มค่าตัวอย่างไปยังเซลล์ "B3"
worksheet.Cells("B3").PutValue(50)

'การเพิ่มแผนภูมิไปยังแผ่นงาน
Dim chartIndex As Integer = worksheet.Charts.Add(ChartType.Column, 5, 0, 25, 10)

'การเข้าถึงอ็อบเจ็กต์ของแผนภูมิที่เพิ่งเพิ่ม
Dim chart As Chart = worksheet.Charts(chartIndex)

'การเพิ่ม NSeries (แหล่งข้อมูลแผนภูมิ) ไปยังแผนภูมิที่มีช่วงจากเซลล์ "A1" ถึง "B3"
chart.NSeries.Add("A1:B3", True)

chart.ShowDataTable = True

'การรับตารางแผนภูมิ
Dim chartTable As ChartDataTable = chart.ChartDataTable

'การตั้งค่าสีฟอนต์ของตารางแผนภูมิ
chartTable.Font.Color = System.Drawing.Color.Red

'การตั้งค่าการมองเห็นของกุญแจในตำนาน
chartTable.ShowLegendKey = False

'การบันทึกไฟล์ Excel
workbook.Save("book1.xls")

คุณสมบัติ

AutoScaleFont

เป็นจริงหากข้อความในอ็อบเจ็กต์เปลี่ยนขนาดฟอนต์เมื่อขนาดของอ็อบเจ็กต์เปลี่ยน ค่าเริ่มต้นคือ True

public bool AutoScaleFont { get; set; }

ค่า Property

bool

BackgroundMode

รับและตั้งค่ารูปแบบการแสดงผลของพื้นหลัง

public BackgroundMode BackgroundMode { get; set; }

ค่า Property

BackgroundMode

Border

ส่งกลับอ็อบเจ็กต์ Border ที่แทนขอบของอ็อบเจ็กต์

public Line Border { get; }

ค่า Property

Line

Font

รับอ็อบเจ็กต์ Aspose.Cells.Charts.ChartDataTable.Font ซึ่งแทนการตั้งค่าฟอนต์ของตารางข้อมูลแผนภูมิที่ระบุ

public Font Font { get; }

ค่า Property

Font

HasHorizontalBorder

เป็นจริงหากตารางข้อมูลแผนภูมิมีขอบเซลล์แนวนอน

public bool HasHorizontalBorder { get; set; }

ค่า Property

bool

HasOutlineBorder

เป็นจริงหากตารางข้อมูลแผนภูมิมีขอบนอก

public bool HasOutlineBorder { get; set; }

ค่า Property

bool

HasVerticalBorder

เป็นจริงหากตารางข้อมูลแผนภูมิมีขอบเซลล์แนวตั้ง

public bool HasVerticalBorder { get; set; }

ค่า Property

bool

ShowLegendKey

เป็นจริงหากกุญแจในตำนานของป้ายข้อมูลมีให้เห็น

public bool ShowLegendKey { get; set; }

ค่า Property

bool

 แบบไทย