Christopher Krause

Christopher Krause

  • NA
  • 24
  • 56.2k

How to add dynamic charts into TX Text Control

Jul 4 2011 9:11 AM
A picture is worth a thousand words. Having a chart representing complex numbers can help to understand trends or to get the "big picture".

In earlier versions of the .NET Framework, the included chart controls were very limited. But that has been changed in .NET 4.0. The included chart controls are very powerful and beautiful at the same time. You can choose from 34 different chart types including pie, doughnut or line charts. We often thought about integrating chart support into TX Text Control itself - but this is not longer necessary.

The following sample shows how to insert these charts into TX Text Control. Generally, the way is very straight forward: A chart is created and the resulting image is inserted into the document. But this sample shows how to integrate charts into your document automation implementations.

A special ApplicationField is inserted to represent the chart. Just like the supported image merge fields, the field gets an indicator: "chart:". During the merge process, you can pass the data points to the special ApplicationField. The ApplicationField itself contains various switches indicating the type, size or whether it should render a legend or not.

The advantage of using an ApplicationField to represent the charts is that you can integrate this process into your mail merge applications. The template contains the special ApplicationField and your application is creating the chart dynamically based on the passed data.

In this sample project, a simple interface shows the different settings that can be adjusted to create a chart. Select a chart type from the combo box, choose a specific diagram size and decide whether a legend should be rendered or not. After that, you can change the pre-defined data points in the data grid view or you can add additional data rows. Click on Add ApplicationField to insert the chart into the document.

The minimum requirements for this sample application are TX Text Control .NET for Windows Forms trial version and Visual Studio 2010.

Download the sample here: How to add dynamic charts into TX Text Control


About TX Text Control:

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, reliable product.

Contact Informations:

[email protected]

North & South America:
Phone: +1 704-370-0110
Phone: +1 877-462-4772 (toll free)

Europe:
Phone: +49 (0)421 42 70 67 10

Asia Pacific:
Phone: +886 2-2797-8508