TX Text Control .NET for WPF

ChartFrame Class

Class|Introduced in 18.0
Namespace
TXTextControl.DataVisualization
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Inherits
  1. FrameBase
  2. ChartFrame

Description

An instance of the ChartFrame class represents a chart and its layout in a Text Control document. A chart can be positioned in the document like an image or a textframe, either geometrically or as a single character. Geometrically its position can either be relative to a paragraph to which it is anchored or relative to the complete document. The ChartFrame class handles the positioning of the chart in the document. A chart frame is always associated with a chart control of the type System.Windows.Forms.DataVisualization.Charting.Chart. This chart control handles the appearance and the data of the chart. All charts in a document are contained in a ChartCollection. The collection can also be used to add charts to or to remove charts from the document. The chart collection can be obtained from a TextControl or ServerTextControl through the Charts property.

Syntax

public class ChartFrame : FrameBase

Examples

The following example creates a Chart Frame instance and configures its export compression quality setting for a document workflow.

TXTextControl.DataVisualization.ChartFrame chartFrame = new(new System.ComponentModel.Component());
chartFrame.ExportCompressionQuality = 90;

Members

Constructors

ConstructorDescription
ChartFrameInitializes a new instance of the ChartFrame class.

Properties

PropertyDescription
AlignmentGets or sets the frame's horizontal alignment when it is anchored to a paragraph. (Inherited from FrameBase.)
BoundsGets the frame's bounding rectangle relative to the upper left corner of the document. (Inherited from FrameBase.)
ChartGets the chart control associated with the chart frame. It must be of the type System.Windows.Forms.DataVisualization.Charting.Chart.
DescriptiveTextGets or sets a descriptive text for the frame. An empty string indicates that the frame has no such text. An empty string can also be used to delete a previously set text. (Inherited from FrameBase.)
ExportCompressionQualitySets a value between 1 and 100, which is the quality of a lossy data compression used, if the chart's image is exported. It is only used, if the image data is compressed with a lossy compression algorithm. A value of 100 indicates the maximum quality, a value of 1 indicates the minimum quality. If this property is set to zero, which is the default value, Text Control uses the quality value set with the SaveSettings.ImageCompressionQuality property.
ExportFileNameGets or sets the file name, when the chart's image is exported. An empty string indicates that no export filename has currently be specified for the chart's image. In this case a constructed filename is used. A filename is constructed in the following form: <document_filename>_<number>.<extension>. The technical article Loading and Saving Images describes where newly created image files are stored.
ExportFilterIndexGets or sets the format used, if a chart's image is exported. This is the number of the filter in the string returned through the ImageCollection.ExportFilters property, beginning with number one. A value of zero indicates that no export format has currently be specified for the chart. In this case the chart's image is saved in Windows Bitmap format. The technical article Loading and Saving Images lists the currently possible values for this property.
ExportResolutionGets or sets the maximum resolution in dots per inch in which the chart's image is saved. If this property's value is zero, which is the default value, Text Control uses the resolution value set with the SaveSettings.ImageMaxResolution property.
IDGets or sets an identifier for the frame. It must be a one-based value. A value of zero indicates that the image, text frame, chart, barcode or drawing has no identifier. Zero can also be used to delete a previously set identifier. (Inherited from FrameBase.)
InsertionModeGets or sets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page. (Inherited from FrameBase.)
LocationGets or sets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline. (Inherited from FrameBase.)
MoveableDetermines whether a frame can be moved in the document at run time with the built-in mouse interface. (Inherited from FrameBase.)
NameGets or sets a name for the frame. An empty string indicates that the frame has no name. An empty string can also be used to delete a previously set name. (Inherited from FrameBase.)
SaveModeDetermines whether the chart's image is stored through its binary data or through a file reference. By default a chart's image is stored with its binary data.
SizeGets or sets the frame's size in twips. For images this property is read only. (Inherited from FrameBase.)
SizeableDetermines whether the frame can be resized at run time with the built-in mouse interface. (Inherited from FrameBase.)
TextDistancesGets or sets the distances, in twips, between the frame and the document's text. The property's value is an array of four variables specifying the distances in the following order: left, top, right and bottom. If a value is set to -1, it is not changed. (Inherited from FrameBase.)
TextPositionRead only. Gets the frame's character position in the document's text (one-based). (Inherited from FrameBase.)

Methods

MethodDescription
AddUndoUnitAdd the current state of the chart which is connected with this ChartFrame to the undo stack. Programmatic changes performed with the chart's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the chart frame's layout in the text is changed.
ChangeZOrderChanges the frame's z-order. (Inherited from FrameBase.)
RefreshRefreshes the chart. Programmatic changes performed with the chart's properties and methods are not automatically refreshed. Calling this method is not necessary, when the chart frame's layout in the text is changed.