# ChartFrame Class

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 18.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Inherits:** `TXTextControl.FrameBase`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DataVisualization > ChartFrame Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/#members)

---

## In This Section

- [ChartFrame.AddUndoUnit Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/addundounit-method/llms.txt): Add 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.
- [ChartFrame.Chart Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/chart-property/llms.txt): Gets the chart control associated with the chart frame. It must be of the type System.Windows.Forms.DataVisualization.Charting.Chart.
- [ChartFrame Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/constructor/llms.txt): Initializes a new instance of the ChartFrame class.
- [ChartFrame.ExportCompressionQuality Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/exportcompressionquality-property/llms.txt): Sets 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.
- [ChartFrame.ExportFileName Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/exportfilename-property/llms.txt): Gets 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.
- [ChartFrame.ExportFilterIndex Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/exportfilterindex-property/llms.txt): Gets 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.
- [ChartFrame.ExportResolution Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/exportresolution-property/llms.txt): Gets 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.
- [ChartFrame.Refresh Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/refresh-method/llms.txt): Refreshes 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.
- [ChartFrame.SaveMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/savemode-property/llms.txt): Determines 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.

---

## Nearby

- **Previous:** [ChartEventArgs.ChartFrame Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/charteventargs/chartframe-property/llms.txt)
- **Next:** [ChartFrame.AddUndoUnit Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/addundounit-method/llms.txt)
