Class ErrorBar

Class ErrorBar

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

แทนที่แถบข้อผิดพลาดของชุดข้อมูล

public class ErrorBar : Line

การสืบทอด

objectLineErrorBar

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

Line.m_lineParent, Line.CompoundType, Line.DashType, Line.CapType, Line.JoinType, Line.BeginType, Line.EndType, Line.BeginArrowLength, Line.EndArrowLength, Line.BeginArrowWidth, Line.EndArrowWidth, Line.ThemeColor, Line.Color, Line.Transparency, Line.Style, Line.Weight, Line.WeightPt, Line.WeightPx, Line.FormattingType, Line.IsAutomaticColor, Line.IsVisible, Line.IsAuto, Line.GradientFill, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

ตัวอย่าง

Workbook workbook = new Workbook();
Cells cells = workbook.Worksheets[0].Cells;
cells["a1"].PutValue(2);
cells["a2"].PutValue(5);
cells["a3"].PutValue(3);
cells["a4"].PutValue(6);
cells["b1"].PutValue(4);
cells["b2"].PutValue(3);
cells["b3"].PutValue(6);
cells["b4"].PutValue(7);

cells["C1"].PutValue("Q1");
cells["C2"].PutValue("Q2");
cells["C3"].PutValue("Y1");
cells["C4"].PutValue("Y2");

int chartIndex = workbook.Worksheets[0].Charts.Add(ChartType.Column, 11, 0, 27, 10);

Chart chart = workbook.Worksheets[0].Charts[chartIndex];
chart.NSeries.Add("A1:B4", true);

chart.NSeries.CategoryData = "C1:C4";

for(int i = 0; i < chart.NSeries.Count; i ++)
{
	Series aseries = chart.NSeries[i];
	aseries.YErrorBar.DisplayType = ErrorBarDisplayType.Minus;
	aseries.YErrorBar.Type = ErrorBarType.FixedValue;
	aseries.YErrorBar.Amount = 5;
}
Dim workbook As Workbook =  New Workbook() 
Dim cells As Cells =  workbook.Worksheets(0).Cells 
cells("a1").PutValue(2)
cells("a2").PutValue(5)
cells("a3").PutValue(3)
cells("a4").PutValue(6)
cells("b1").PutValue(4)
cells("b2").PutValue(3)
cells("b3").PutValue(6)
cells("b4").PutValue(7)

cells("C1").PutValue("Q1")
cells("C2").PutValue("Q2")
cells("C3").PutValue("Y1")
cells("C4").PutValue("Y2")

Dim chartIndex As Integer =  workbook.Worksheets(0).Charts.Add(ChartType.Column,11,0,27,10) 

Dim chart As Chart =  workbook.Worksheets(0).Charts(chartIndex) 
chart.NSeries.Add("A1:B4", True)

chart.NSeries.CategoryData = "C1:C4"

Dim i As Integer
For  i = 0 To chart.NSeries.Count - 1
Dim aseries As ASeries =  chart.NSeries(i) 
aseries.YErrorBar.DisplayType = ErrorBarDisplayType.Minus
aseries.YErrorBar.Type = ErrorBarType.FixedValue
aseries.YErrorBar.Amount = 5
Next

คุณสมบัติ

Amount

แทนที่จำนวนของแถบข้อผิดพลาด

public double Amount { get; set; }

ค่า Property

double

หมายเหตุ

จำนวนต้องมากกว่าหรือเท่ากับศูนย์

DisplayType

แทนที่ประเภทการแสดงผลของแถบข้อผิดพลาด

public ErrorBarDisplayType DisplayType { get; set; }

ค่า Property

ErrorBarDisplayType

MinusValue

แทนที่จำนวนข้อผิดพลาดเชิงลบเมื่อประเภทแถบข้อผิดพลาดเป็นแบบกำหนดเอง

public string MinusValue { get; set; }

ค่า Property

string

PlusValue

แทนที่จำนวนข้อผิดพลาดเชิงบวกเมื่อประเภทแถบข้อผิดพลาดเป็นแบบกำหนดเอง

public string PlusValue { get; set; }

ค่า Property

string

ShowMarkerTTop

ระบุว่าจะแสดงแถบข้อผิดพลาดด้วย T-top หรือไม่

public bool ShowMarkerTTop { get; set; }

ค่า Property

bool

Type

แทนที่ประเภทจำนวนแถบข้อผิดพลาด

public ErrorBarType Type { get; set; }

ค่า Property

ErrorBarType

ตัวอย่าง

Workbook wb = new Workbook("chart.xlsx");
Chart chart = wb.Worksheets[0].Charts[0];
Series aseries = chart.NSeries[0];
//ตั้งค่าประเภทแถบข้อผิดพลาดแบบกำหนดเอง
aseries.YErrorBar.Type = ErrorBarType.Custom;
aseries.YErrorBar.PlusValue = "=Sheet1!A1";
aseries.YErrorBar.MinusValue = "=Sheet1!A2";
'ตั้งค่าประเภทแถบข้อผิดพลาดแบบกำหนดเอง
aseries.YErrorBar.Type = ErrorBarType.Custom
aseries.YErrorBar.PlusValue = "=Sheet1!A1"
aseries.YErrorBar.MinusValue = "=Sheet1!A2"
 แบบไทย