ProEssentials ActiveX Charting components are used when creating stand-alone client-side EXEs or within containers that accept ActiveX components. This ActiveX Charting Walk-through includes instructions for Microsoft Access 2007-2017 and should apply to later and earlier versions of Access. For Excel Click here for Excel Charting ActiveX Walkthrough
For help finding ActiveX specific features in our help system, the .Net Reference section is the best source for researching properties. Our help topics show ActiveX OCX specific syntax in the OCX/VCL header near top of topic.
When installing ProEssentials, the setup program installs the ProEssentials 32 bit DLL into the System32 directory on 32 bit systems. On 64 bit systems, the 32 bit DLL is installed in SysWow64 and the 64 bit DLL is installed in System32.
The setup also installs the following Charting OCX files into the same system folders as DLLs and registers them. Note, you do not register our DLLs. Note, the 32 bit and 64 bit OCXs have the same file names and classIDs and the OS will correctly invoke the appropriate version based on the run time need. The relevant files are:
Pro Components:
Standard Components:
The following information demonstrates how to create your first ProEssentials Access ActiveX Charting implementation using the Visual Basic. It discusses using the OCX charting components to add interactive engineering and scientific charting content to your Access Databases. Please see the other charting examples provided within the product/evaluation; including a larger MS Access example database already containing charts and example code on various forms.
1) From the [New] menu, create a new [Blank Database]
The project opens and shows a default blank table.
2) Using the [Create] menu, Add a new [Blank Form].
Below shows newly created blank form.
3) Click / select the Table1 and referring to below image, enter the following fields and data as shown.
4) Adding the Gigasoft ActiveX Chart to MS Access form.
Click / select the Form1 tab, then...
You see the Insert ActiveX Control dialog showing all ActiveX controls registered with the operating system.
This image shows ProEssentials v7 and v9 installed, which will only be the case if both the v7 and v9 setup programs have been installed.
Select the Pego v9 Control and select OK.
The Pego ActiveX is placed on the form. You may position and size the control as needed.
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.
Note the design view image may not fully refresh while resizing, toggling between design view and layout will cause the chart to re-draw to your new size.
Select the [Design] menu, and then [Property Sheet] menu item to show the property window.
We recommend positioning to top left corner and then setting the Anchor properties to Both. The Anchor properties are found within the Format tab.
Important, select the All tab to show all properties, and change the Name property of the new control to Pego1. The code will we be adding in the next section will require the Name property to be Pego1.
5) Within the [Property Sheet] section, make sure Form is shown as the Selection Type, click the Event tab, and click the [...] for the OnLoad event to open the Visual Basic editor and add the code below to the Form_Load event. Note that within the design view editor, clicking the solid grey area below the detail section will also select the Form and show Form related properties and events.
Enter the code as shown below. You may copy and paste, but also try to write a few lines that use enums to see intellisense.
'// Simple to code = simple to implement and maintain //
Pego1.SubsetByPoint = False '// Allows data to be dynamic //
Pego1.Subsets = 2 '// Subsets = Rows //
Pego1.Points = 10000# '// Points = Columns, set to a max, later reduced //
Pego1.MainTitle = "Hello World"
Pego1.SubTitle = ""
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)
'// Quick way to set many colors via QuickStyle property //
Pego1.BitmapGradientMode = True
Pego1.QuickStyle = PEQS_LIGHT_SHADOW
Pego1.DeskColor = Pego1.PEargb(255, 255, 255, 255)
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.FixedFonts = True
Pego1.FontSize = PEFS_LARGE
'// You will likely set these for all charts //
Pego1.PrepareImages = True
Pego1.CacheBmp = True
Pego1.RenderEngine = PERE_DIRECT2D
Pego1.AntiAliasGraphics = True
Pego1.AntiAliasText = True
'// Setting this True will enable Data HotSpots, //
'// but we need to add code to respond to hot spot event //
Pego1.AllowDataHotSpots = True
'// Always finish your property settings with this setting //
Pego1.PEactions = REINITIALIZE_RESETIMAGE
'// VB Code to load data from Table1 //
Dim db As Database
Dim MyRS As DAO.Recordset
Dim MySQL As String
MySQL = "select Field1, Field2, Field3 from Table1"
Set db = CurrentDb()
Set MyRS = db.OpenRecordset(MySQL)
Dim nCount As Integer
Do While (MyRS.EOF = False)
Pego1.YData(0, nCount) = MyRS("Field1")
Pego1.YData(1, nCount) = MyRS("Field2")
Pego1.PointLabels(nCount) = MyRS("Field3")
nCount = nCount + 1
MyRS.MoveNext
Loop
Pego1.Points = nCount
MyRS.Close
Set MyRS = Nothing
Pego1.PEactions = REINITIALIZE_RESETIMAGE
Your project code should look similar to...
6) The code above enabled the DataHotSpot event, so we should place some appropriate code in the DataHotSpot event.
To add the DataHotSpot event, we need to be inside the Visual Basic editor.
If the editor is not open, within the [Property Sheet] section, make sure Form is shown as the Selection Type, click the Event tab, and click the [...] area for the OnLoad event to open the Visual Basic editor.
Now use the top drop down list boxes to 1, select Pego1 and 2, select the DataHotSpot event.
Add the following code to the Pego1_DataHotSpot event.
Call MsgBox("Subset " + Str$(SubsetIndex) + _
", Point " + Str$(PointIndex) + _
" with a value of " + Str$(Pego1.YData(SubsetIndex, PointIndex)))
7) Save the database, accept all the default names, with Form1 selected, switch to Form View by right clicking the Form1 tab and selecting Form View, or click the Form View button at very bottom right of the Access application window (Next to NUMLOCK). Move the mouse over a bar and click to trigger the DataHotSpot event.
This completes this walkthrough.
Please read the remaining sections within Chapter 3 and review the demo code and documentation that's installed with the eval/product.
Once installed, the demo program can be accessed via shortcut...
Start / ProEssentials v9 / PeDemo
Note that our main charting demo is replicated in WPF and Winform C#.NET, VB.NET, VC++ MFC, Delphi, Builder all accessible from where you installed ProEssentials. These are great for modifying an existing demo to test potential modifications before implementing within your applications.
귀사의 조직과 최종 사용자들에게 가장 쉽고 가장 전문적인 혜택을 제공함으로써 귀사께서 성공하시는 것이 당사의 최우선 목표입니다.
프로에센셜은 자체 차트 컴포넌트가 필요한 전기 공학 전문가들로부터 태어났습니다. 프로에센셜을 사용하는 탑 엔지니어링 기업들 명단에 참여히세요.
프로에센셜 고객이 되어주셔서 감사드리며, 프로에센셜 차트 제작 엔진을 연구해주셔서 감사드립니다.