NOTE: for modern v8 ActiveX examples, we recommend the Access 2013, Excel 2013, and VB6-WIN8 tutorials.
The quick big picture and OCX Charting potential for Vb6, Office vba, Internet Explorer, and any container that accepts ocx activex interfaces.
- See the new v8 demo (only 17 meg and uninstalls no problem.)
- Includes OCX Charts and Native Charting.
- 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.
The following demonstrates how to create your first Visual
Basic VB6 OCX Charting implementation with ProEssentials v8. It discusses
installing the OCX charting control, adding the OCX chart to a project, writing
your first few lines of code, and shows the final results.
the ProEssentials evaluation and/or product, the
setup program installs the ProEssentials DLL and
OCX Charting interfaces into the system directory.
These files are:
|ProEssentials Pro DLL
||3D Scientific Graph
||Pie Chart Object
||ProEssentials Standard DLL
||3D Scientific Graph
||Pie Chart Object
The setup program
also registers the OCX Charts with the operating
system, which prepares Visual Basic for inclusion
of ProEssentials components. You can manually
register an OCX with "REGSVR32.EXE"
found in your system/system32 dir. You can also
use this utility to manually un-register an OCX
by using the "-u" command.
launch Visual Basic - Visual Studio and create a new "Standard
Use the Project / Components... menu item to open
the [Components] dialog.
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.
button will close the [Components]
dialog and places those items selected into Visual
Basic's ToolBox as shown.
Pego1.Subsets = 2
Pego1.Points = 10
For s = 0 To 1
For p = 0 To 9
p) = 5 + Rnd * 5
Pego1.MainTitle = "My Title"
Pego1.SubTitle = ""
Pego1.YAxisLabel = "My Data"
Pego1.XAxisLabel = ""
Pego1.SubsetLabels(0) = "Hello"
Pego1.SubsetLabels(1) = "World"
Pego1.BitmapGradientMode = True
Pego1.QuickStyle = PEQS_LIGHT_INSET
Pego1.FixedFonts = True
Pego1.LegendStyle = PELS_1_LINE_INSIDE_AXIS
Pego1.PEactions = REINITIALIZE_RESETIMAGE
Click the "Pego"ocx chart from the ToolBox and
then click and drag a rectangle selection on Form1's
Note, ProEssentials Std uses control name "PegoStd"
The adjacent image shows what you see. This represents
the default state of a ProEssentials ocx chart. 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).
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
of code will improve your understanding and demonstrate
the auto-code completion features supported by
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.
and SubTitle are set. Note that setting SubTitle
to an empty string hides the subtitle.
and XAxisLabel are set similarly.
SubsetLabels(0) sets the first subset label. (1) sets the second
Next, we set various other properties controlling
is set to REINITIALIZE_RESETIMAGE which tells
ProEssentials you're done setting properties.
Use Visual Basic's Run / Start Menu (short cut F5)
and you'll see the resulting form to the left.
Congratulations, you've just completed your first
Visual Basic / OCX Charting / ProEssentials implementation.
This example is very simple and you'll likely set
other properties such as: Width/Height so that the control uses Form1's client area as
PointLabels which will replace the "1,2,3..." along
SubsetLineTypes which controls line styles.
SubsetColors which controls line colors.
controls the type of chart created, Line, Bar,
Area, Point, etc.