Back

Topic

[KB689]X-Y plot from CSV file

Tags: ActiveX, Trend

11 years ago
By RM
Options
Print
Applies to:

PcVue 10.0 but the XY Plot OCX could be used with any PcVue version supporting VBA.


Summary:

An example of an X-Y plot created using a freely available and Open Source ActiveX component.
The ActiveX component and its source are available from the following URL:
http://www.codeproject.com/Articles/3214/2D-Graph-ActiveX-Control
Originator: FC


Details:

How to use the XY Plot ActiveX with PcVue.

Step 1. Register the ActiveX control with the Operating System.

  1. Open a Command Prompt. On most OS this can be found in Start.All Programs.Accessories. If using Windows 7 the Command Prompt must be opened using the Run as administrator option. (Right click)
  2. Type in regsvr32 <path>NTGraph.ocx. For example regsvr32 E:\OCXstore\NTGraph.ocx. A dialog will be displayed indicating if registration was successful (or not). Note that if the path contains any white space it must be enclosed in quotation marks. For example regsvr32 “E:\OCX store\NTGraph.ocx”

regsvr32
Step 2. Authorize the ActiveX control within PcVue.

  1. Start PcVue with the project in which you intend to use the XY Plot ActiveX.
  2. From the menu select the command Configure.Preferences.ActiveX Controls. Find the XY Plot in the left pane and select it. Click the >> button. This validates the ActiveX and makes it available to the project using the Favorites dialog.

activex favourites
Step 3. Paste the XY Plot ActiveX control into a mimic and code its operation.

  1. Open a mimic and select design mode. From the menu select Insert.Favorite ActiveX control. From the dialog select the XY Plot and insert it in the mimic.
  2. The appearance of the XY Plot can be configured from a dialog that is displayed by double clicking it.
    xyplot config
    See the help supplied with the XY Plot for information.
  3. The operation of the XY Plot must then be coded using VBA. An example, populating the plot with values from a file, is available in the sample project below. Note that you can also configure the appearance programatically.

xyplot script


Sample project:Project : XY_PLOT.zip
ActiveX Control: NTGraph_bin.zipDownload attachments:


]

Created on: 22 Jan 2014 Last update: 04 Sep 2024