C#.NET Chart Source Code

.Net source code to print and export images and data to Excel and MS Word.

 

C#.NET Charting Source Code Interface

[ For the ultimate in charting robustness and seamless integration within your .NET Windows applications.]
   

The ProEssentials C#.NET UI source code comes as a Visual Studio VS2005 project. The code contains approximately 10,000 lines. The code compiles into an assembly "ChartUI.DLL" that is easily added to any .NET C#, VB, C++ project by simply adding a Reference or adding the project to create a multi-project solution.

ProEssentials popup menus:

  • Right-Click Popup menus provide quick customizations and access to export and maximization.
  • All properties effecting menu behavior are supported, including the CustomMenu features.
  • In the image to right, note "Category A" and "Option" items are implemented via ProEssentials Custom Menu features (example 127 in the PeDemo).
  • Given you have the source, the use of the Custom Menu features is now optional and still provides an easy method to add a quick item to our menus. But if you need full control of the menus, the source code provides the means.
  • .NET also makes it easy to switch a menu from being a context-popup to a window strip-menu.
.Net Chart source code within Visual Studio.
   

.Net Chart source code for chart customization dialogs.

Customization Dialog:

  • The customization dialogs allow the end user to adjust the chart's look, plotting style, select and/or deselect subsets/series/points/data, change axis ranges, change fonts, change chart and subset colors and subset styles.
  • All properties effecting dialog behavior are supported, including the showing of various tabs and dialog sections.
  • The Color tab implements color selector controls and the Style tab implements owner draw combo boxes to allow line-style and point-symbol-style adjustments.
  • Having the source allows for the easy addition of more tabs and/or altering their contents.
  • The source separates the customization dialog into 1) a .NET user control and 2) a simple WinForm dialog container. This allows the customization user control to be easily placed within other windows if needed.
   

Export Dialog:

  • The export dialog allows end-user to export EMF, WMF, JPG, PNG images to clipboard or file. Export Text-Data to clipboard or file which is easily imported into Excel. And allows end-user to print high quality hard copies.
  • All properties effecting dialog behavior are supported.
  • Having the source allows for better integration with your software. The best advantages would be allowing custom page headers/footers on printouts, adding custom images/watermarks on printouts and image exports, and adding logic to automate multiple exports and printouts.

Net chart source code for exporting emf, wmf, png, bmp, jpeg, and text to excel and ms word.

   

.Net charting source code including printing.

Print Dialog:

  • The print dialog allows end-user to print a hard-copy of a chart. ProEssentials has many properties that effect the printing process. This dialog takes advantage of these features.
  • Our print dialog allows for quickly adjusting the color / monochrome setting and immediately shows a WYSIWYG representation of the chart being printed.
  • Our normal embedded native C++ print dialog logic has been ported to managed code. Managed code does have a big advantage over C++/MFC when interfacing with printers. Having the .NET source for this print dialog will jump start the process of creating the absolute best printing procedures for your unique needs.
   

Text-Data Export Dialog:

  • The Text-Data export dialog allows end-user to export the chart's data in a text form in either tab or comma delimited format to clipboard or file destinations. The tab delimited form easily imports into MS Excel and MS Word via the clipboard or a file.
  • All properties effecting text export behavior are supported. This allows for easily controlling default dialog settings so end user can store their common export settings within your application.

.Net charting source code for exporting data to excel.

 

GENERAL HOW-TO

ProEssentials v6 version 6.0.0.74 or later is needed as new property interfaces are used with the new PEUI API.

ChartUI namespace

  • CustomizeTabs Class: UserControl containing Tab control, Tab Pages, OK, Cancel, Apply, Export, and Maximize Buttons
  • CustomizeDlg Class: WinForm used as a container of the CustomizeTabs UserControl.
  • ExportDlg Class: WinForm used to export images, text/data to clipboard, file, printer.
  • MaximizeDlg Class: WinForm used to contain maximized separate instance of chart.
  • PrintDlg Class: WinForm providing printing functionality.
  • TextExportDlg Class: WinForm providing Text/Data export to file or clipboard.
  • ChartMenu Class: Class to create a ContextMenuStrip that will be attached to a chart.

1) Add a Reference to your project, browse and add "ChartUI.DLL"

2) Add to the top of any form containing a ProEssentials chart...

Imports ChartUI
Imports Gigasoft.ProEssentials.Enums


or

using ChartUI;
using Gigasoft.ProEssentials.Enums

3) When initializing chart, disable built in user interface like...

Pego1.PeSpecial.UsingUiSourceCode = True

...then allocate a ChartMenu object...

Dim cmenu_g As ChartUI.ChartMenu
cmenu_g = New ChartMenu(Pego1.PeSpecial.HObject, Pego1, Me)

or

ChartMenu cmenu_g;
cmenu_g = new ChartMenu(Pego1.PeSpecial.HObject, Pego1, this);

Be sure to call menu constructor at end of your chart initialization so menu type properties are reflected.
If you change properties effecting menu characteristics, re-call the constructor.

First parameter to ChartMenu constructor identifies control being effected by menu, it must be a ProEssentials control.
Second parameter can be any Window but is usually the same control. This attaches the ContextStripMenu to this window.

4) To replicate ProEssentials user interface...

a) Create a chart DoubleClick event to invoke code...

Dim cd As New CustomizeDlg(Pego1.PeSpecial.HObject)
cd.ShowDialog(Me)

or
CustomizeDlg cd = new CustomizeDlg(Pego1.PeSpecial.HObject);
cd.ShowDialog();

b) Create a chart KeyPress event to invoke code...

If (e.KeyChar = " ") Then
    Dim cd As New CustomizeDlg(Pego1.PeSpecial.HObject)
    cd.ShowDialog()
End If
If (e.KeyChar = "X" Or e.KeyChar = "x") Then
    Dim ed As New ExportDlg(Pego1.PeSpecial.HObject)
    ed.ShowDialog()
End If
If (e.KeyChar = "P" Or e.KeyChar = "p") Then
    Dim pd As New PrintDlg(Pego1.PeSpecial.HObject, 0, 0, True)
    pd.ShowDialog()
End If
If (e.KeyChar = "D" Or e.KeyChar = "d") Then
    Dim ted As New TextExportDlg(Pego1.PeSpecial.HObject, False, "")
    ted.ShowDialog()
End If
If (e.KeyChar = "M" Or e.KeyChar = "m") Then
    Dim md As New MaximizeDlg(Pego1.PeSpecial.HObject)
    md.ShowDialog(Me)
End If


or

if (e.KeyChar == ' ')
{
    CustomizeDlg cd = new CustomizeDlg(Pego1.PeSpecial.HObject);
    cd.ShowDialog();
}
if (e.KeyChar == 'X' || e.KeyChar == 'x')
{
    ExportDlg ed = new ExportDlg(Pego1.PeSpecial.HObject);
    ed.ShowDialog();
}
if (e.KeyChar == 'P' || e.KeyChar == 'p')
{
    PrintDlg pd = new PrintDlg(Pego1.PeSpecial.HObject, 0, 0, true);
    pd.ShowDialog();
}
if (e.KeyChar == 'D' || e.KeyChar == 'd')
{
    TextExportDlg ted = new TextExportDlg(Pego1.PeSpecial.HObject, false, "");     ted.ShowDialog();
}
if (e.KeyChar == 'M' || e.KeyChar == 'm')
{
    MaximizeDlg md = new MaximizeDlg(Pego1.PeSpecial.HObject);
    md.ShowDialog();
}

Online developer reference

Complete online technical reference to the ProEssentials product. Chapter 2's .NET Reference is the best mechanism to navigate the large quantity of properties and features.  Walk-Throughs of .NET charting in VB.NET, C#.NET, ASP, VC, VB6, and Delphi get you started quickly.

learn more about .net charting, see Chapter 2

Online interactive demo

Interactive Financial, Engineering, Scientific, and Business examples give you an instant taste of ProEssentials' power.

view our .net charting demo

Letter from the President

CONGRATULATIONS! Reading this page means you're likely a product manager, product owner, or should be one.

Charting Component Strengths, print it, read it!