VB6 ActiveX Charting example adding charts (MSChart alternative) to your Visual Basic software.

[ VB Visual Basic Client-Side EXE Development ]

The Charting ActiveX solution for VB, Access, Excel, Office vba, Internet Explorer, and any container that accepts ActiveX COM interfaces.

  • See the new v8 demo (only 15 meg and uninstalls no problem.)
  • Includes ActiveX Charting native demos.
  • Size, Shape, Right Click, Export, Zoom (especially date and log scales), Pan, and Rotate.
  • Study the code to discover the ease of use.
  • Your company, team, vendors, and end-users deserve the best.
See the demo...
activex chart for finance engineering and more activex Chart 3d surface scatter wireframe terrain

The following demonstrates how to create your first Visual Basic Charting ActiveX implementation. It discusses installation, adding the charting activex to a project, writing your first few lines of code, and shows the final chart. ProEssentials is the ideal MS Chart alternative due to its simple (property/event/method) api, free technical support, robust charting capabilities, and high quality rendering to screen and printer.

Project / Components... menu Installation...

Adding MSChart alternative activex chart to your Visual Basic, Access, Excel project.

When installing the ProEssentials evaluation and/or product, the setup program installs the ProEssentials DLL and ActiveX Charting interfaces into the system directory. These files are:

PEGRP32F.DLL ProEssentials Pro DLL
PEGO32F.OCX Graph Object
PESGO32F.OCX Scientific Graph Object
PE3DO32F.OCX 3D Scientific Graph Object
PEPSO32F.OCX Polar Object
PEPCO32F.OCX Pie Chart Object

PEGRPSF.DLL ProEssentials Standard DLL
PEGOSF.OCX Graph Object
PESGOSF.OCX Scientific Graph Object
PE3DOSF.OCX 3D Scientific Graph Object
PEPSOSF.OCX Polar Object
PEPCOSF.OCX Pie Chart Object
 

The setup program also registers the ActiveXs with the operating system, which prepares Visual Basic for inclusion of ProEssentials components. You can manually register an ActiveX with "REGSVR32.EXE" found in your system32 or syswow64 on 64 bit systems. You can also use this utility to manually un-register an ActiveX by using the "-u" command.

After installation, launch Visual Basic and create a new "Standard EXE" project.

Use the Project / Components... menu item to open the [Components] dialog.


Components... Dialog Adding ProEssentials to a VB project...
Adding Charting ActiveX component MSChart alternative to VB6

Within the [Components] Dialog, scroll down until you see the Gigasoft entries and select those shown in the left image. Note that the [Controls] tab is active.

ProEssentials separates charting functionality between 5 controls. This makes it easier to find related property, methods, and events.

Clicking the [OK] button will close the [Components] dialog and places those items selected into Visual Basic's ToolBox as shown.

Gigasft charting ActiveXs within the Tool Window, not MSChart.


Form1... Adding ProEssentials to a Form...
Charting ActiveX within Visual Studio design time window.

Pego1.MainTitle = "Hello World"
Pego1.SubTitle = ""
Pego1.Subsets = 2
Pego1.Points = 6
Pego1.YData(0, 0) = 10
Pego1.YData(0, 1) = 30
Pego1.YData(0, 2) = 20
Pego1.YData(0, 3) = 40
Pego1.YData(0, 4) = 30
Pego1.YData(0, 5) = 50
Pego1.YData(1, 0) = 15
Pego1.YData(1, 1) = 63
Pego1.YData(1, 2) = 74
Pego1.YData(1, 3) = 54
Pego1.YData(1, 4) = 25
Pego1.YData(1, 5) = 34
Pego1.PointLabels(0) = "Jan"
Pego1.PointLabels(1) = "Feb"
Pego1.PointLabels(2) = "Mar"
Pego1.PointLabels(3) = "Apr"
Pego1.PointLabels(4) = "May"
Pego1.PointLabels(5) = "June"
Pego1.SubsetLabels(0) = "For .Net Framework"
Pego1.SubsetLabels(1) = "or MFC, ActiveX, VCL"
Pego1.YAxisLabel = "Simple Quality Rendering"
Pego1.SubsetColors(0) = Pego1.PEargb(60, 0, 180, 0)
Pego1.SubsetColors(1) = Pego1.PEargb(180, 0, 0, 130)
Pego1.BitmapGradientMode = False
Pego1.QuickStyle = PEQS_LIGHT_SHADOW
Pego1.GraphPlusTable = PEGPT_BOTH
Pego1.DataPrecision = PEDP_NODECIMALS
Pego1.LabelBold = True
Pego1.PlottingMethod = GPM_BAR
Pego1.GradientBars = 8
Pego1.BarGlassEffect = True
Pego1.LegendLocation = PELL_LEFT
Pego1.DataShadows = PEDS_3D
Pego1.FontSize = PEFS_LARGE
Pego1.PrepareImages = True
Pego1.CacheBmp = True
Pego1.RenderEngine = PERE_DIRECT2D
Pego1.AntiAliasGraphics = True
Pego1.AntiAliasText = True
Pego1.AllowDataHotSpots = True
Pego1.PEactions = REINITIALIZE_RESETIMAGE



Pego ActiveX Chart. MSChart alternative. Click the "Pego"control from the ToolBox and then click and drag a rectangle selection on Form1's canvas.

Note, ProEssentials Std uses control name "PegoStd".

The adjacent image shows what you see. This represents the default state of a ProEssentials Graph. The default state has one subset with four data points. In the course of constructing your own charts, you'll set the properties Subsets and Points which define the quantity of data your chart will hold. You'll then pass data via the YData(subset, point) two dimensional property array. The following section shows example code of passing data. Note, if we were constructing a Scientific Graph (Pesgo), we'd also set XData(subset, point).

ProEssentials uses the terms Subsets and Points but you can think of these as Rows and Columns. Passing data is as simple as filling each Subset with Points worth of data.

Use Visual Basic's View / Code menu to open the Code Window. Then select [Form] from the top left drop-down combo box. The event combobox on the top right will switch to [Load]. Enter the code as shown. Writing this small amount of code will improve your understanding and demonstrate the auto-code completion features supported by ProEssentials.


VB Code Window... Code Comments...
Charting ActiveX source code within Visual Studio. Code is much cleaner than MSChart's code.



The first two lines set Subsets and Points. These define the amount of data you'll be passing.

Next, a nested For-Next loop passes random data into the YData(s, p) property array.

Next, MainTitle and SubTitle are set. Note that setting SubTitle to an empty string hides the subtitle.

The YAxisLabel and XAxisLabel are set similarly.

SubsetLabels(0) sets the first subset label. (1) sets the second subset label.

Next, we set various other properties controlling visual aspects.

Finally, PEactions is set to REINITIALIZE_RESETIMAGE which tells ProEssentials you're done setting properties.

ActiveX Chart Example... Congratulations...
MS Chart ActiveX alternative

Use Visual Basic's Run / Start Menu and you'll see the resulting form to the left. Congratulations, you've just completed your first Visual Basic / ProEssentials implementation.

 

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 activex charting, see Chapter 3

Online interactive demo

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

Our online charting demo

Letter from the President

Thank you for researching. Call, email and let's talk charting.

Thank you.