Legend
Legend class
Encapsulates the object that represents the chart legend.
Properties
| Name | Type | Description |
|---|---|---|
| Position | Number | Gets or sets the legend position type. The value of the property is LegendPositionType integer constant. Default positio |
| LegendEntries | LegendEntryCollection | Gets a collection of all the LegendEntry objects in the specified chart legend. Setting the legend entries of the surfac |
| LegendEntriesLabels | ArrayList | Gets the labels of the legend entries after call Chart.Calculate() method. NOTE: This member is now obsolete. Instead, p |
| IsOverLay | boolean | Gets or sets whether showing the legend without overlapping the chart. |
| IsAutoText | boolean | Indicates the text is auto generated. |
| IsDeleted | boolean | Indicates whether this data labels is deleted. |
| TextHorizontalAlignment | Number | Gets and sets the text horizontal alignment. The value of the property is TextAlignmentType integer constant. |
| TextVerticalAlignment | Number | Gets or sets the text vertical alignment of text. The value of the property is TextAlignmentType integer constant. |
| RotationAngle | Number | Represents text rotation angle. 0: Not rotated. 255: Top to Bottom. -90: Downward. 90: Upward. |
| IsAutomaticRotation | boolean | Indicates whether the text of the chart is automatically rotated. |
| Text | String | Gets or sets the text of a frame’s title. |
| LinkedSource | String | Gets and sets a reference to the worksheet. |
| TextDirection | Number | Represents text reading order. The value of the property is TextDirectionType integer constant. NOTE: This member is now |
| ReadingOrder | Number | Represents text reading order. The value of the property is TextDirectionType integer constant. |
| DirectionType | Number | Gets and sets the direction of text. The value of the property is ChartTextDirectionType integer constant. |
| IsTextWrapped | boolean | Gets or sets a value indicating whether the text is wrapped. |
| IsResizeShapeToFitText | boolean | Gets or sets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text |
| IsInnerMode | boolean | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the |
| Chart | Chart | Gets the chart to which this object belongs. |
| Border | Line | Gets the Line . |
| Area | Area | Gets the area . |
| TextFont | Font | Gets a Font object of the specified ChartFrame object. NOTE: This member is now obsolete. Instead, please use ChartFrame |
| TextOptions | TextOptions | Gets and sets the options of the text. |
| Font | Font | Gets a Font object of the specified ChartFrame object. |
| AutoScaleFont | boolean | True if the text in the object changes font size when the object size changes. The default value is True. |
| BackgroundMode | Number | Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. |
| Background | Number | Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. NOTE: Thi |
| IsAutomaticSize | boolean | Indicates whether the chart frame is automatic sized. |
| X | Number | Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. How to convert units of 1/4 |
| Y | Number | Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. How to convert units of 1/4 |
| Height | Number | Gets or sets the height of frame in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Height |
| Width | Number | Gets or sets the width of frame in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Width In |
| Shadow | boolean | True if the frame has a shadow. |
| ShapeProperties | ShapePropertyCollection | Gets the ShapeProperties object. |
| IsDefaultPosBeSet | boolean | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set. |
| DefaultX | Number | Represents x of default position |
| DefaultY | Number | Represents y of default position |
| DefaultWidth | Number | Represents width of default position |
| DefaultHeight | Number | Represents height of default position |
| DefaultXRatioToChart | Number | |
| DefaultYRatioToChart | Number | |
| DefaultWidthRatioToChart | Number | |
| DefaultHeightRatioToChart | Number | |
| XRatioToChart | Number | |
| YRatioToChart | Number | |
| WidthRatioToChart | Number | |
| HeightRatioToChart | Number | |
| XPixel | Number | |
| YPixel | Number | |
| WidthPixel | Number | Represents width |
| HeightPixel | Number | Represents height |
Methods
| Name | Description |
|---|---|
| getLegendLabels | Gets the labels of the legend entries after call Chart.Calculate() method. |
| characters | Returns a Characters object that represents a range of characters within the text. |
| setPositionAuto | Set position of the frame to automatic |
Legend.Position property
Gets or sets the legend position type. The value of the property is LegendPositionType integer constant. Default position is right. If the legend is at left or right side of the chart, setting Legend.X property will not take effect. If the legend is at top or bottom side of the chart, setting Legend.Y property will not take effect.
Type: Number
Legend.LegendEntries property
Gets a collection of all the LegendEntry objects in the specified chart legend. Setting the legend entries of the surface chart is not supported. So it will return null if the chart type is surface chart type.
Type: LegendEntryCollection
Legend.LegendEntriesLabels property
Gets the labels of the legend entries after call Chart.Calculate() method. NOTE: This member is now obsolete. Instead, please use Legend.GetLegendLabels method. This property will be removed 12 months later since November 2023. Aspose apologizes for any inconvenience you may have experienced.
Type: ArrayList
Legend.IsOverLay property
Gets or sets whether showing the legend without overlapping the chart.
Type: boolean
Legend.IsAutoText property
Indicates the text is auto generated.
Type: boolean
Legend.IsDeleted property
Indicates whether this data labels is deleted.
Type: boolean
Legend.TextHorizontalAlignment property
Gets and sets the text horizontal alignment. The value of the property is TextAlignmentType integer constant.
Type: Number
Legend.TextVerticalAlignment property
Gets or sets the text vertical alignment of text. The value of the property is TextAlignmentType integer constant.
Type: Number
Legend.RotationAngle property
Represents text rotation angle. 0: Not rotated. 255: Top to Bottom. -90: Downward. 90: Upward.
Type: Number
Legend.IsAutomaticRotation property
Indicates whether the text of the chart is automatically rotated.
Type: boolean
Legend.Text property
Gets or sets the text of a frame’s title.
Type: String
Legend.LinkedSource property
Gets and sets a reference to the worksheet.
Type: String
Legend.TextDirection property
Represents text reading order. The value of the property is TextDirectionType integer constant. NOTE: This member is now obsolete. Instead, please use ChartTextFrame.ReadingOrder property. This property will be removed 12 months later since March 2020. Aspose apologizes for any inconvenience you may have experienced.
Type: Number
Legend.ReadingOrder property
Represents text reading order. The value of the property is TextDirectionType integer constant.
Type: Number
Legend.DirectionType property
Gets and sets the direction of text. The value of the property is ChartTextDirectionType integer constant.
Type: Number
Legend.IsTextWrapped property
Gets or sets a value indicating whether the text is wrapped.
Type: boolean
Legend.IsResizeShapeToFitText property
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.
Type: boolean
Legend.IsInnerMode property
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. Only for Xlsx file.
Type: boolean
Legend.Chart property
Gets the chart to which this object belongs.
Type: Chart
Legend.Border property
Gets the Line .
Type: Line
Legend.Area property
Gets the area .
Type: Area
Legend.TextFont property
Gets a Font object of the specified ChartFrame object. NOTE: This member is now obsolete. Instead, please use ChartFrame.Font property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Type: Font
Legend.TextOptions property
Gets and sets the options of the text.
Type: TextOptions
Legend.Font property
Gets a Font object of the specified ChartFrame object.
Type: Font
Legend.AutoScaleFont property
True if the text in the object changes font size when the object size changes. The default value is True.
Type: boolean
Legend.BackgroundMode property
Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant.
Type: Number
Legend.Background property
Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. NOTE: This member is now obsolete. Instead, please use ChartFrame.BackgroundMode property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Type: Number
Legend.IsAutomaticSize property
Indicates whether the chart frame is automatic sized.
Type: boolean
Legend.X property
Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? X In Pixels = X * Chart.ChartObject.Width / 4000;
Type: Number
Legend.Y property
Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Y In Pixels = Y * Chart.ChartObject.Height / 4000;
Type: Number
Legend.Height property
Gets or sets the height of frame in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Height In Pixels = Y * Chart.ChartObject.Height / 4000;
Type: Number
Legend.Width property
Gets or sets the width of frame in units of 1/4000 of the chart area. How to convert units of 1/4000 to pixels? Width In Pixels = Width * Chart.ChartObject.Height / 4000;
Type: Number
Legend.Shadow property
True if the frame has a shadow.
Type: boolean
Legend.ShapeProperties property
Gets the ShapeProperties object.
Type: ShapePropertyCollection
Legend.IsDefaultPosBeSet property
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
Type: boolean
Legend.DefaultX property
Represents x of default position
Type: Number
Legend.DefaultY property
Represents y of default position
Type: Number
Legend.DefaultWidth property
Represents width of default position
Type: Number
Legend.DefaultHeight property
Represents height of default position
Type: Number
Legend.DefaultXRatioToChart property
Type: Number
Legend.DefaultYRatioToChart property
Type: Number
Legend.DefaultWidthRatioToChart property
Type: Number
Legend.DefaultHeightRatioToChart property
Type: Number
Legend.XRatioToChart property
Type: Number
Legend.YRatioToChart property
Type: Number
Legend.WidthRatioToChart property
Type: Number
Legend.HeightRatioToChart property
Type: Number
Legend.XPixel property
Type: Number
Legend.YPixel property
Type: Number
Legend.WidthPixel property
Represents width
Type: Number
Legend.HeightPixel property
Represents height
Type: Number
getLegendLabels()
Gets the labels of the legend entries after call Chart.Calculate() method.
characters(startIndex, length)
Returns a Characters object that represents a range of characters within the text.
| Parameter | Type | Description |
|---|---|---|
| startIndex | Number | The index of the start of the character. |
| length | Number | The number of characters. |
Returns: Characters object.
setPositionAuto()
Set position of the frame to automatic