ChartDirector 7.1 (.NET Edition)
Installation
Installing ChartDirector for .NET
ChartDirector for .NET is distributed as a zip file. Windows may block DLLs in downloaded zip files, so before you can use it, please
unblock it first.
After unblocking, simply extract the zip file to the directory you want ChartDirector to be located.
The ChartDirector documentation is in the "ChartDirector\doc" subdirectory in compiled HTML (CHM) format. On Windows, you can read CHM documentation by simply double clicking on the CHM file.
Running ChartDirector Sample Programs
ChartDirector for .NET includes a lot of sample programs for various application types. They are designed as tutorials and examples on how to use ChartDirector. It is strongly recommended that you try at least one set of sample programs.
Application Framework | Location |
---|
Windows Forms (.NET Core/.NET 5 or later) | ChartDirector\NetCoreWinCharts |
WPF (.NET Core/.NET 5 or later) | ChartDirector\NetCoreWPFCharts |
ASP.NET Core Razor Pages (.NET Core/.NET 5 or later) | ChartDirector\NetCoreRazorCharts |
ASP.NET Core MVC (.NET Core/.NET 5 or later) | ChartDirector\NetCoreMvcCharts |
Windows Forms (.NET Framework) | ChartDirector\NetWinCharts |
WPF (.NET Framework) | ChartDirector\NetWPFCharts |
ASP.NET Web Forms (.NET Framework) | ChartDirector\NetWebCharts |
ASP.NET MVC (.NET Framework) | ChartDirector\NetMvcCharts |
Installing Controls in Visual Studio Toolbox
Certain .NET application types, such as Windows Forms, WPF and ASP.NET Web Forms, can use controls. ChartDirector comes with the following controls for these application types:
For Visual Studio 2017 15.9 and later versions, when you reference the ChartDirector NuGet package in your project, Visual Studio should automatically add the controls to its toolbox for that project. So installing the controls is optional. See "Using ChartDirector in Your Own Projects" below for more details.
You may want to install the controls if you are using older versions of Visual Studio, or if you want the controls in the toolbox for all projects without using NuGet. Note that as of Visual Studio 2019, only .NET Framework controls can be installed without using NuGet.
- Open or create a WPF, Windows Forms or a ASP.NET Web Forms project, and display a window in the designer. Visual Studio would then display the toolbox with some controls.
- Right click on the toolbox and select "Add Tab". Name the tab "ChartDirector".
- Right click on the newly added tab and click "Choose Items".
- To add Windows Forms and Web Forms controls, select the ".NET Framework Components" tab. Click "Browse", select the ChartDirector DLL "ChartDirector\lib\netchartdir.dll", and click OK,
If you are on a Windows Forms project, Visual Studio will warn that the Web Forms controls are not applicable and will be hidden in the toolbox. Similarly, if you are on a ASP.NET project, Visual Studio may warn that the Windows Forms control are not applicable. This is normal. Just press OK and continue.
- To add WPF Controls, repeat the previous step with the "WPF Components" tab.
Installing Visual Studio Integrated Help
The ChartDirector distribution includes documentation in CHM (Compiled HTML Help) format, which is readable in all Windows computers. The ChartDirector Visual Studio Integrated Help is the same content installed into the Visual Studio help viewer and integrated into Visual Studio Intellisense. It provides the following features:
- When you highlight a ChartDirector method in the source code and press F1, the help viewer will open the documentation for that method.
- You can look up ChartDirector classes, methods and sample program in the "Index" tab of Visual Studio help viewer, and also search for them in the help viewer.
To install ChartDirector Visual Studio Integrated Help, please download it from
http://www.advsofteng.com/download.html and follow the installation instructions on the download page.
Using ChartDirector in Your Own Projects
In order to use ChartDirector in a project, it needs to reference the ChartDirector assembly. It can be done using one of the following methods:
- If you have installed ChartDirector controls to the Visual Studio toolbox, dragging the a ChartDirector control onto the designer window will automatically add a reference to the ChartDirector assembly.
- You can install the NuGet package "ChartDirector.Net" (for web applications) or "ChartDirector.Net.Desktop.Controls" (for desktop applications) to your project. To do this, use "Project/Manage NuGet Packages", search for "ChartDirector.Net", select the package for your project type, and press "Install". If you are using Visual Studio 2017 or later, and your project type supports controls (such as Windows Forms, WPF or ASP.NET Web Forms), Visual Studio should automatically add ChartDirector controls to its toolbox.
Note: Visual Studio may update the toolbox only if the NuGet package manager and all windows in the designer are closed. When you reopen a window in the designer, Visual Studio should display the updated toolbox with ChartDirector controls.
Note: For .NET Core, after adding controls to the toolbox, if you immediately drag the control to a window in the designer, Visual Studio may just display it as a rectangle. You would need to compile the project at least once (even if the project is empty) before Visual Studio can correctly display the controls. (This applies to all .NET Core controls, not just ChartDirector.)
- For .NET Framework applications (but not .NET Core applications) that do not use controls (such as ASP.NET MVC), you can manually add a reference to the ChartDirector assembly. To to this, use "Project/Add Reference", press "Browse", and the ChartDirector assembly at "ChartDirector/lib/netchartdir.dll", and press "Add" to add it to your project.
Using ChartDirector On Linux
Certain .NET application types (such as ASP.NET Core MVC) can run on Linux, but Visual Studio will not automatically pack the necessary Linux runtime with your application. If you do want to run your application on Linux, depending on the Linux type, please add one of the following Microsoft NuGet package to your project:
- SkiaSharp.NativeAssets.Linux 2.88.3
This package works with Linux that has Fontconfig installed. Fontconfig is the font manager on Linux. Modern Linux should have Fontconfig. However, some Linux systems may be severely stripped down to reduce size, and it may not install Fontconfig by default. You may have to manually install it on the Linux system.
- SkiaSharp.NativeAssets.Linux.NoDependencies 2.88.3
This package does not require Fontconfig. Without Fontconfig, Linux would be unable to map logical font names (such as "Times New Roman Bold") to the actual font file. It is possible the Linux does not have any font at all. That means your application may need to include its own fonts. In the charting code, fonts need to be specified using path names instead of logical font names.
Installing the ChartDirector License
If you have purchased a license to use ChartDirector, you should have a license key delivered to your via email and postal mail. Please install the license key as according to the following instructions.
Even without a license key, ChartDirector will work normally, but the charts will include a yellow bar at the bottom that marks the charts as produced by the "unregistered" ChartDirector. You can freely test ChartDirector for as long as necessary.
If your license key is for upgrading from a previous version of ChartDirector, please append the upgrade license key to the previous version license key, and use the combined license key.
ChartDirector Developer License
Please follow the steps below to install the license key for the "ChartDirector Developer License":
- Create an ASCII file using Notepad or other text editor, and put the license key in it. The whole file should contain only the license key. Save the file as "chartdir.lic".
Note that some text editors, such as Notepad, may automatically append ".txt" to the filename. If file is saved as "chartdir.lic", it may end up as "chartdir.lic.txt". In this case, please rename the file back to "chartdir.lic".
- Copy the "chartdir.lic" to the windows directory (normally "c:\windows" on Windows) or the "/etc" directory (for Linux/macOS).
The above directory is a system directory and may require administrative privileges for write access. If you are copying using the command prompt, please make sure you use "Run As administrator" to start the command prompt (for Windows), or use "sudo" (for Linux/macOS).
- If you cannot copy to a system directory (eg. due to lack of administrative privilege), you can copy "chartdir.lic" to the "bin" subdirectory (for ASP.NET applications), or to the application EXE directory (for Windows Forms or WPF application).
The license file should remove the "unregistered" message on the charts. If the license file appears to have no effect, please refer to
http://www.advsofteng.com/license_diag.html for trouble-shooting instructions.
ChartDirector Redistribute License
The "ChartDirector Redistribute License" can be installed using the same method as that of the "ChartDirector Developer License". If your application is distributed as a compiled executable, you can compile the license key directly into the executable. This avoids redistributing the license file. To do this, simply add a line in your code to call
Chart.setLicenseCode and pass the license key as the argument.
[VB] | Chart.setLicenseCode(".....your-license-key.....") |
[C#] | Chart.setLicenseCode(".....your-license-key....."); |
© 2023 Advanced Software Engineering Limited. All rights reserved.