.netCHARTING v10.2 Documentation Send comments on this topic.
Using with WinForms
Getting Started > Installation & Usage > Using with WinForms

Glossary Item Box

.netCHARTING Winforms Support

The winforms control will not function in a web environment. In addition, the web version (dotnetcharting.dll) will not function outside of a web environment.

WinForms Usage

The process to use the WinForms edition of .netCHARTING is simple. If you are already familiar with .netCHARTING the winforms version will also be familiar. For using in your Visual Studio winforms application, add dotnetCHARTING.WinForms.dll as a reference. Then add the dll to the toolbox in toolbox in Visual Studio. When this is completed drag and drop the charting control from the toolbox onto a form to get started.

.net 4.0 Client Profile

As of .netCHARTING v8 and later, the client profile framework 4 is supported with a separate .netCHARTING assembly. To utilize this version, you can develop against the assembly included in the root and for deployment drop in and replace the assembly with the version included in this folder. The assemblies have the same name and version so you do not need to re-reference or recompile, but the comments will differ if you wish to confirm a given assembly right click on dotnetchartingWinForms.dll, select properties and confirm the product name. The client dll version will note “.netCHARTING WinForms Client” in the name.

Differences from the WebForms version:

  1. The winforms Chart control is inherited from System.Windows.Forms.userControl and you have access to all events,properties and methods of UserControl in addition to the full .netCHARTING object model.
  2. Width and Height  properties are "int" type versus WebControl which are Unit type.
  3. HitTest method.  This method accepts the X,Y position on the chart image and returns the corresponding object for that point of the Image. These are 3  overloaded methods for HitTest method: 
        
    [C#]
    
    HitTestInfo myObj = HitTest(x,y);
    [Visual Basic]
    HitTestInfo  myObj =  HitTest(x,y)
    
    x,y are int and represent the point you want to get the related object from.
                 
    [C#]
    HitTestInfo  myObj =  HitTest(myPoint);
    
    [Visual Basic]
    HitTestInfo  myObj =  HitTest(myPoint)
    
    myPoint is "Point" type and represents the point you want to get the related object from.

    [C#]
    HitTestInfo  myObj =  HitTest();
    
    [Visual Basic]
    HitTestInfo  myObj =  HitTest()
    
    If you do not pass the cursor position, internally this method uses the position from the Chart control.  This usage would be applicable when using the winforms control in a winforms project.

    Currently, the HitTestInfo Class has one property called "Object". It will hold the object clicked and can be used for drilldown or other advanced integration with the chart in a winforms environment.
  4. When you use Object.URL properties, such as Element.URL when you click on the Element, a new browser window will be launched with the URL value specified.  URL target has no effect in a winforms environment.

©2021. All Rights Reserved.