Class ChartTextFrame
Contents
[
Hide
]ChartTextFrame class
Encapsulates the object that represents the frame object which contains text.
public class ChartTextFrame : ChartFrame
Properties
Name | Description |
---|---|
virtual Area { get; } | Gets the area .(Inherited from ChartFrame .) |
virtual AutoScaleFont { get; set; } | True if the text in the object changes font size when the object size changes. The default value is True.(Inherited from ChartFrame .) |
Background { get; set; } | (Obsolete.) Gets and sets the display mode of the background(Inherited from ChartFrame .) |
BackgroundMode { get; set; } | Gets and sets the display mode of the background(Inherited from ChartFrame .) |
virtual Border { get; } | Gets the border .(Inherited from ChartFrame .) |
DefaultHeight { get; } | Represents height of default position(Inherited from ChartFrame .) |
DefaultWidth { get; } | Represents width of default position(Inherited from ChartFrame .) |
DefaultX { get; } | Represents x of default position(Inherited from ChartFrame .) |
DefaultY { get; } | Represents y of default position(Inherited from ChartFrame .) |
virtual DirectionType { get; set; } | Gets and sets the direction of text. |
virtual Font { get; } | Gets a Font object of the specified ChartFrame object.(Inherited from ChartFrame .) |
virtual Height { get; set; } | Gets or sets the height of frame in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
IsAutomaticRotation { get; } | Indicates whether the text of the chart is automatically rotated. |
virtual IsAutomaticSize { get; set; } | Indicates whether the chart frame is automatic sized.(Inherited from ChartFrame .) |
virtual IsAutoText { get; set; } | Indicates the text is auto generated. |
IsDefaultPosBeSet { get; } | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.(Inherited from ChartFrame .) |
IsDeleted { get; set; } | Indicates whether this data labels is deleted. |
IsInnerMode { get; set; } | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels.(Inherited from ChartFrame .) |
IsResizeShapeToFitText { get; set; } | Gets or sets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside. |
virtual IsTextWrapped { get; set; } | Gets or sets a value indicating whether the text is wrapped. |
virtual LinkedSource { get; set; } | Gets and sets a reference to the worksheet. |
ReadingOrder { get; set; } | Represents text reading order. |
RotationAngle { get; set; } | Represents text rotation angle. |
Shadow { get; set; } | True if the frame has a shadow.(Inherited from ChartFrame .) |
ShapeProperties { get; } | Gets the ShapeProperties object.(Inherited from ChartFrame .) |
virtual Text { get; set; } | Gets or sets the text of a frame’s title. |
TextDirection { get; set; } | (Obsolete.) Represents text reading order. |
virtual TextFont { get; } | (Obsolete.) Gets a Font object of the specified ChartFrame object.(Inherited from ChartFrame .) |
TextHorizontalAlignment { get; set; } | Gets and sets the text horizontal alignment. |
virtual TextOptions { get; } | Gets and sets the options of the text.(Inherited from ChartFrame .) |
TextVerticalAlignment { get; set; } | Gets or sets the text vertical alignment of text. |
virtual Width { get; set; } | Gets or sets the width of frame in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
virtual X { get; set; } | Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
virtual Y { get; set; } | Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.(Inherited from ChartFrame .) |
Methods
Name | Description |
---|---|
Characters(int, int) | Returns a Characters object that represents a range of characters within the text. |
virtual SetPositionAuto() | Set position of the frame to automatic(Inherited from ChartFrame .) |
Examples
[C#]
namespace Demos
{
using Aspose.Cells;
using Aspose.Cells.Charts;
using Aspose.Cells.Drawing;
using Aspose.Cells.Drawing.Texts;
using System;
public class ChartTextFrameDemo
{
public static void ChartTextFrameExample()
{
// Create a new workbook
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
// Add sample data
worksheet.Cells["A1"].PutValue("Category");
worksheet.Cells["A2"].PutValue("A");
worksheet.Cells["A3"].PutValue("B");
worksheet.Cells["A4"].PutValue("C");
worksheet.Cells["B1"].PutValue("Value");
worksheet.Cells["B2"].PutValue(10);
worksheet.Cells["B3"].PutValue(20);
worksheet.Cells["B4"].PutValue(30);
// Add a chart to the worksheet
int chartIndex = worksheet.Charts.Add(ChartType.Column, 5, 0, 15, 5);
Chart chart = worksheet.Charts[chartIndex];
// Add series to the chart
chart.NSeries.Add("B2:B4", true);
chart.NSeries.CategoryData = "A2:A4";
// Access the chart title
ChartTextFrame title = chart.Title;
title.Text = "Sample Chart";
title.TextHorizontalAlignment = TextAlignmentType.Center;
title.TextVerticalAlignment = TextAlignmentType.Center;
title.RotationAngle = 0;
title.IsAutoText = false;
title.IsDeleted = false;
title.TextDirection = TextDirectionType.LeftToRight;
title.ReadingOrder = TextDirectionType.LeftToRight;
title.DirectionType = ChartTextDirectionType.Horizontal;
title.IsTextWrapped = true;
title.IsResizeShapeToFitText = true;
title.IsInnerMode = false;
title.AutoScaleFont = true;
title.BackgroundMode = BackgroundMode.Transparent;
title.IsAutomaticSize = true;
title.X = 0;
title.Y = 0;
title.Height = 400;
title.Width = 400;
title.Shadow = true;
// Save the workbook
workbook.Save("ChartTextFrameExample.xlsx");
workbook.Save("ChartTextFrameExample.pdf");
}
}
}
See Also
- class ChartFrame
- namespace Aspose.Cells.Charts
- assembly Aspose.Cells