Class DataLabels

Class DataLabels

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

รวมกลุ่มของ DataLabel objects ทั้งหมดสำหรับ Series ที่ระบุ

public class DataLabels : ChartTextFrame

การสืบทอด

objectChartFrameChartTextFrameDataLabels

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

ChartTextFrame.m_IsAutoText, ChartTextFrame.m_deleted, ChartTextFrame.horizontal, ChartTextFrame.vertical, ChartTextFrame.rotation, ChartTextFrame.m_CharsList, ChartTextFrame.Characters(int, int), ChartTextFrame.IsAutoText, ChartTextFrame.IsDeleted, ChartTextFrame.TextHorizontalAlignment, ChartTextFrame.TextVerticalAlignment, ChartTextFrame.RotationAngle, ChartTextFrame.IsAutomaticRotation, ChartTextFrame.Text, ChartTextFrame.LinkedSource, ChartTextFrame.ReadingOrder, ChartTextFrame.DirectionType, ChartTextFrame.IsTextWrapped, ChartTextFrame.IsResizeShapeToFitText, ChartFrame.m_IsAutoXPos, ChartFrame.m_IsAutoYPos, ChartFrame.m_IsOffsetPosBeSet, ChartFrame.m_fontIndex, ChartFrame.m_AutoScaleFont, ChartFrame.m_BackgroundMode, ChartFrame.m_isAutoSize, ChartFrame.SetPositionAuto(), ChartFrame.IsInnerMode, ChartFrame.Border, ChartFrame.Area, ChartFrame.TextOptions, ChartFrame.Font, ChartFrame.AutoScaleFont, ChartFrame.BackgroundMode, ChartFrame.IsAutomaticSize, ChartFrame.X, ChartFrame.Y, ChartFrame.Height, ChartFrame.Width, ChartFrame.Shadow, ChartFrame.ShapeProperties, ChartFrame.IsDefaultPosBeSet, ChartFrame.DefaultX, ChartFrame.DefaultY, ChartFrame.DefaultWidth, ChartFrame.DefaultHeight, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

ตัวอย่าง

//ตั้งค่า DataLabels ในแผนภูมิ
Workbook wb = new Workbook("chart.xlsx");
Chart chart = wb.Worksheets[0].Charts[0];
DataLabels datalabels;
for (int i = 0; i  <chart.NSeries.Count; i++)
{
    datalabels = chart.NSeries[i].DataLabels;
    //ตั้งตำแหน่งของ DataLabels
    datalabels.Position = LabelPositionType.InsideBase;
    //แสดงชื่อหมวดหมู่ใน DataLabels
    datalabels.ShowCategoryName = true;
    //แสดงค่าใน DataLabels
    datalabels.ShowValue = true;
    //ไม่แสดงเปอร์เซ็นต์ใน DataLabels
    datalabels.ShowPercentage = false;
    //ไม่แสดงคีย์ตำนาน
    datalabels.ShowLegendKey = false;
}
'ตั้งค่า DataLabels ในแผนภูมิ
Dim datalabels As DataLabels
Dim i As Integer
For i = 0 To chart.NSeries.Count - 1 Step 1
    datalabels = chart.NSeries(i).DataLabels
    'ตั้งตำแหน่งของ DataLabels
    datalabels.Position = LabelPositionType.InsideBase
    'แสดงชื่อหมวดหมู่ใน DataLabels
    datalabels.ShowCategoryName= True
    'แสดงค่าใน DataLabels
    datalabels.ShowValue = True
    'ไม่แสดงเปอร์เซ็นต์ใน DataLabels
    datalabels.ShowPercentage = False
    'ไม่แสดงคีย์ตำนาน
    datalabels.ShowLegendKey = False
Next

คุณสมบัติ

Area

รับ Aspose.Cells.Charts.DataLabels.Area?text=area

public override Area Area { get; }

ค่าของคุณสมบัติ

Area

BackgroundMode

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

public BackgroundMode BackgroundMode { get; set; }

ค่าของคุณสมบัติ

BackgroundMode

Border

รับ Aspose.Cells.Drawing.Line?text=border

public override Line Border { get; }

ค่าของคุณสมบัติ

Line

DirectionType

รับและตั้งค่าทิศทางของข้อความ

public override ChartTextDirectionType DirectionType { get; set; }

ค่าของคุณสมบัติ

ChartTextDirectionType

Font

รับฟอนต์ของ DataLabels;

public override Font Font { get; }

ค่าของคุณสมบัติ

Font

IsAutoText

ระบุว่าข้อความถูกสร้างโดยอัตโนมัติ

public override bool IsAutoText { get; set; }

ค่าของคุณสมบัติ

bool

IsNeverOverlap

ระบุว่าการแสดง datalabels ไม่ทับซ้อนกัน (สำหรับแผนภูมิวงกลม)

public bool IsNeverOverlap { get; set; }

ค่าของคุณสมบัติ

bool

IsTextWrapped

รับหรือตั้งค่าค่าที่ระบุว่าข้อความถูกห่อหรือไม่

public override bool IsTextWrapped { get; set; }

ค่าของคุณสมบัติ

bool

Number

รับและตั้งค่า รูปแบบหมายเลขที่สร้างโดยระบบ

public int Number { get; set; }

ค่าของคุณสมบัติ

int

NumberFormat

แสดงถึงสตริงรูปแบบสำหรับวัตถุ DataLabels

public string NumberFormat { get; set; }

ค่าของคุณสมบัติ

string

NumberFormatLinked

เป็นจริงหากรูปแบบหมายเลขเชื่อมโยงกับเซลล์ (เพื่อให้รูปแบบหมายเลขเปลี่ยนในป้ายชื่อเมื่อมันเปลี่ยนในเซลล์)

public bool NumberFormatLinked { get; set; }

ค่าของคุณสมบัติ

bool

Position

แสดงถึงตำแหน่งของป้ายข้อมูล

public LabelPositionType Position { get; set; }

ค่าของคุณสมบัติ

LabelPositionType

SeparatorType

รับหรือตั้งค่าประเภทตัวแบ่งที่ใช้สำหรับป้ายข้อมูลในแผนภูมิ

public DataLabelsSeparatorType SeparatorType { get; set; }

ค่าของคุณสมบัติ

DataLabelsSeparatorType

หมายเหตุ

ในการตั้งค่าตัวแบ่งที่กำหนดเอง โปรดตั้งค่าคุณสมบัติ Aspose.Cells.Charts.DataLabels.SeparatorType เป็น Aspose.Cells.Charts.DataLabelsSeparatorType.Custom และจากนั้นระบุค่าที่คาดหวังสำหรับ Aspose.Cells.Charts.DataLabels.SeparatorValue

SeparatorValue

รับหรือตั้งค่าค่าตัวแบ่งที่ใช้สำหรับป้ายข้อมูลในแผนภูมิ

public string SeparatorValue { get; set; }

ค่าของคุณสมบัติ

string

ShapeType

รับหรือตั้งค่าประเภทรูปร่างของป้ายข้อมูล

public DataLabelShapeType ShapeType { get; set; }

ค่าของคุณสมบัติ

DataLabelShapeType

ShowBubbleSize

แสดงถึงพฤติกรรมการแสดงค่าร้อยละของป้ายข้อมูลในแผนภูมิที่กำหนดไว้จริง แสดงค่าร้อยละ ถ้าเป็นจริง แสดงค่าร้อยละ ถ้าเป็นเท็จให้ซ่อน

public bool ShowBubbleSize { get; set; }

ค่าของคุณสมบัติ

bool

ShowCategoryName

แสดงถึงพฤติกรรมการแสดงชื่อหมวดหมู่ของป้ายข้อมูลในแผนภูมิที่กำหนดไว้จริง แสดงชื่อหมวดหมู่ให้กับป้ายข้อมูลในแผนภูมิ ถ้าเป็นจริง ถ้าเป็นเท็จให้ซ่อน

public bool ShowCategoryName { get; set; }

ค่าของคุณสมบัติ

bool

ShowCellRange

ระบุว่าจะแสดงช่วงเซลล์เป็นป้ายข้อมูลหรือไม่

public bool ShowCellRange { get; set; }

ค่าของคุณสมบัติ

bool

ShowLegendKey

แสดงถึงพฤติกรรมการแสดงคีย์ตำนานของป้ายข้อมูลในแผนภูมิที่กำหนดไว้จริง ถ้าคีย์ตำนานของป้ายข้อมูลมองเห็นได้

public bool ShowLegendKey { get; set; }

ค่าของคุณสมบัติ

bool

ShowPercentage

แสดงถึงพฤติกรรมการแสดงค่าร้อยละของป้ายข้อมูลในแผนภูมิที่กำหนดไว้จริง แสดงค่าร้อยละ ถ้าเป็นจริง ถ้าเป็นเท็จให้ซ่อน

public bool ShowPercentage { get; set; }

ค่าของคุณสมบัติ

bool

ShowSeriesName

ระบุว่าชื่อซีรีส์แสดงสำหรับป้ายข้อมูลในแผนภูมิหรือไม่ ถ้าเป็นจริงให้แสดงชื่อซีรีส์ ถ้าเป็นเท็จให้ซ่อน

public bool ShowSeriesName { get; set; }

ค่าของคุณสมบัติ

bool

ShowValue

แสดงถึงพฤติกรรมการแสดงค่าของป้ายข้อมูลในแผนภูมิที่กำหนดไว้จริง แสดงค่า ถ้าเป็นจริง ถ้าเป็นเท็จให้ซ่อน

public bool ShowValue { get; set; }

ค่าของคุณสมบัติ

bool

Text

รับหรือตั้งค่าข้อความของป้ายข้อมูล

public override string Text { get; set; }

ค่าของคุณสมบัติ

string

วิธีการ

ApplyFont()

ใช้ฟอนต์ของป้ายข้อมูลกับโหนดลูกทั้งหมด

public void ApplyFont()
 แบบไทย