ChartFX for .NET from Software FX is an add-on for Visual Studio.NET that allows developers to integrate advanced charting and graphing capabilities into applications without a lot of custom code. In this primer, Builder AU Technical Editor, David McAmis looks at some of the features and functionality provided by this product.
If you have ever tried to integrate charting or graphing into an application, you know how difficult it is to create this functionality from scratch. Luckily, there are a number of third-party tools available for Visual Studio.NET, including Chart FX for .NET (ChartFX). Unlike some of the other third-party tools or components that are simply older COM components with a .NET wrapper around them, ChartFX was written from the ground up using C# when Visual Studio.NET was first released and can be used in both Windows and Web applications. You can use ChartFX with both Visual Studio.NET 2002 and 2003 and the company has announced support for the upcoming Visual Studio.NET 2005 release, formerly code-named “Whidbey”.
The installation of ChartFX was simple and automatically created a program group with the product documentation and sample files. Using some of these sample files will allow you to get familiar with some of ChartFX’s features and capabilities.
To add charting to your own applications, open Visual Studio.NET, create a new project and then look in the Toolbox for a section marked “ChartFX DevStudio”, as shown below in Figure A.
|Visual Studio interface|
This section contains all of the different ChartFX tools that were installed and to add a chart to your application, simply drag and drop the Chart tool from the toolbox to your form. This will open the ChartFX for .NET Wizard shown below in Figure B, which will guide you through creating your graph or chart.
The first step in creating a new chart or graph is to pick the type of object you want to create. ChartFX supports a wide range of business and scientific graph formats, including
- Surface Control
You can preview these graphs using either a “detailed” or “graphical” view, with the graphical view showing you what the resulting chart or graph would look like. Once you have selected the type of graph, the next step is to select the colour palette. There are a number of preset palettes for you to choose from, which should make it easier to have a consistent interface across your application. The third step in the wizard is where you control the visual elements within the chart or graph, including the borders, legends, etc. and finally, the last step of the wizard is for miscellaneous formatting options, like setting the main and series titles.
Once you have formatted your chart or graph using the wizard you can then preview your application to see how the chart will look. At this point, ChartFX will use sample data to display your graph as it will appear. The next step is to actually tie your chart into the back-end data within your application. This sounds complicated, but ChartFX makes it easy. ChartFX can use data stored in XML files, text files, collections, arrays, etc. or you can use the API to specify what data should be used in the chart or bind directly to an ADO.NET data set. The documentation for the product is well organised and written and there are walkthroughs, examples and sample applications that you can use to come up to speed on the different binding methods and formatting your chart programmatically.
As a whole, the product might be a little expensive but is a welcome addition to a .NET developer’s toolkit and will appeal to both novice and experienced developers looking for an easy to use charting tool.
ChartFX for .NET
Company: Software FX
Price: Starting at AU$1440
System Requirements: .NET Framework Final Release (Build 1.0.3705 or above), .NET Development IDE, such as: Visual Studio .NET Release Version (Build 7.0.9466 or above) or Borland C# Builder Release Version