TX Text Control .NET for Windows Forms X8
now supports the insertion of chart controls of the type DataVisualization.Charting.Chart
. It is part of the .NET Framework since version 4.0, but can be added to prior versions as well.
A chart can be positioned like an image or textframe, either geometrically or as a single character.
The new ChartFrame
class handles the positioning of the chart in a document. Such a
ChartFrame is always associated with a Chart control that handles the
appearance and the data of the chart.
The goal in this sample is to insert a bar chart filled with XML data into a document. The following XML data should be used:
<?xml version="1.0" encoding="utf-8" ?>
In order to insert a chart diagram into the document, we need to create a new chart. Make sure that a reference to System.Windows.Forms.DataVisualization.Charting.Chart has been added to your project.
Each chart object needs a ChartArea that represents a chart area on the chart image and a Series object that is connected to that area.
Chart chart = new Chart();
// set the ChartType
chart.Series["series1"].ChartArea = "chartArea1";
chart.Series["series1"].ChartType = SeriesChartType.Bar;
a next step, we can load the XML into a DataSet. The column names are
used to set the member of the chart data source used to bind the X and Y
values of the series.
DataSet ds = new DataSet();
chart.Series.XValueMember = ds.Tables.Columns.ColumnName;
chart.Series.YValueMembers = ds.Tables.Columns.ColumnName;
the first table of the DataSet is specified as the data source for the
Chart object. A new ChartFrame is created and inserted into the Charts
collection of TX Text Control.
chart.DataSource = ds.Tables;
ChartFrame chartFrame = new ChartFrame(chart);
TX Text Control
was originally released in 1991, since then more than 50,000 copies have been sold. Starting off as a single, small DLL, TX Text Control
has made its way through 16-bit DLL and VBX versions to today‘s
Enterprise edition with its .NET and ActiveX components. The recent
addition to the family, TX Text Control .NET Server
, offers all of TX Text Control
advanced word processing functionality in an easy-to-use server-side
.NET component. Customers benefit from these years of experience, large
user base, and at the same time, appreciate developing with a mature,
North & South America:
Phone: +1 704-370-0110
Phone: +1 877-462-4772 (toll free)
Phone: +49 (0)421 42 70 67 10
Phone: +886 2-2797-8508