Using Charts with TX Text Control .NET for Windows 31.0 in .NET 6
The chart controls included in the .NET Framework are deprecated and were not ported to .NET (Core). This article shows how to use a .NET 6 version of the DataVisualization control with TX Text Control .NET for Windows Forms (and ASP.NET).

For .NET Framework 2.0 and later, Microsoft licensed the Dundas charting controls to bring charting support to .NET Windows Forms (and ASP.NET). The namespace System.Windows.Forms.DataVisualization is now officially deprecated, but the .NET team at Microsoft kept the door slightly open by publishing the sources on GitHub to enable charting features for WinForms applications that are developed on .NET Core 3 and better.
.NET Compatible Fork
Based on this repository, there are multiple forks including this fork that added .NET 6 support:
https://github.com/kirsan31/winforms-datavisualization
If you clone this repository, build the System.Windows.Forms.DataVisualization.dll and reference it in your project, you can directly use these charts within a .NET 6 Windows Forms application:
// create a new chart control
Chart chart = new Chart();
// add a chart area
chart.ChartAreas.Add("chartArea1");
chart.Series.Add("series1");
chart.Series["series1"].ChartArea = "chartArea1";
chart.Series["series1"].ChartType = SeriesChartType.Bar;
// connect to a data source
DataSet ds = new DataSet();
ds.ReadXml("data.xml");
chart.Series[0].XValueMember = ds.Tables[0].Columns[0].ColumnName;
chart.Series[0].YValueMembers = ds.Tables[0].Columns[1].ColumnName;
chart.DataSource = ds.Tables[0];
chart.DataBind();
// create a chart frame
TXTextControl.DataVisualization.ChartFrame frame =
new TXTextControl.DataVisualization.ChartFrame(chart);
frame.Name = "points";
// add chart to the document
textControl1.Charts.Add(frame, -1);
The following XML is used as the sample data source:
<?xml version="1.0" encoding="utf-8" ?>
<sales>
<points>
<country>Country 1</country>
<value>100</value>
</points>
<points>
<country>Country 2</country>
<value>120</value>
</points>
<points>
<country>Country 3</country>
<value>80</value>
</points>
</sales>
The result can be seen in the following screenshot:
TX Text Control Fork
We forked this repository to make it compatible to TX Text Control .NET for Windows Forms. If you want to use the out-of-the-box ribbon tabs to insert and format added chart objects, you can clone our fork of the repository.
https://github.com/TextControl/winforms-datavisualization
In order to integrate this version, the following steps must be followed.
-
Clone the repository and open it in Visual Studio.
https://github.com/TextControl/winforms-datavisualization -
Find the created NuGet package System.Windows.Forms.DataVisualization.1.0.0.nupkg in the Release or Debug folder and copy that into the Text Control Offline Packages folder:
C:\Program Files (x86)\Text Control GmbH\NuGetPackages -
In your Windows Forms application, select the project in the Solution Explorer and click Project -> Manage NuGet Packages... from the main menu.
-
Select Text Control Offline Packages as the Package source and click Browse.
-
Select System.Windows.Forms.DataVisualization and click Install.
When using the RibbonInsertTab and RibbonChartLayoutTab in your application, the added charting control is recognized automatically and the charting functionality is enabled.
Windows Forms
Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.
Related Posts
Upgrading a .NET Framework Windows Forms App to a .NET 8 Windows Forms App…
This tutorial shows how to upgrade a .NET Framework Windows Forms App to a .NET 6 Windows Forms App by using the .NET Upgrade Assistant. In addition, you will learn how to replace the references…
Windows Forms.NET 6TextControl
Upgrading a .NET Framework Windows Forms App to a .NET 6 Windows Forms App
This article explains how to upgrade a .NET Framework Windows Forms App to a .NET 6 Windows Forms App using the .NET Upgrade Assistant.
Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub
This article gives a quick overview of the new repositories, their structure and our plans for the future.
Windows FormsGetting Started.NET 6
Getting Started with Windows Forms (.NET 5 and better)
This article shows how to use the TX Text Control .NET for Windows Forms TextControl class within a .NET 6 application in Visual Studio 2022.
Windows Forms and WPF Comeback: .NET 6 and 7. Our Commitment to Windows…
Windows Forms was introduced in the first version of .NET and Visual Studio in 2001. Since then it has grown in popularity specifically for rapid, WYSIWYG development. With the release of .NET…