Visit Gigasoft's Web Site
 ProEssentials v10 Help
Chapter 4 VCL Builder C++ Charting Walk-Through

The following information demonstrates how to create your first Embarcadero Builder 13 C++ ProEssentials VCL Charting implementation. It discusses installation, adding ProEssentials to a project, writing your first few lines of code.

Open Gigasoft.cbproj... Installation...

Builder C++ charting package

 

Builder C++ charting package

When running the ProEssentials setup, the setup program installs the ProEssentials DLLs into system32 and SysWow64. It also installs the ProEssentials VCL interfaces into C:\ProEssentials10\Builder and C:\ProEssentials10\Delphi. Note if your Embarcadero IDE has both Delphi and Builder personalities, install into Builder first:

If upgrading from an ealier ProEssentials, first remove the ProEssentials components from the
Builder IDE before proceeding.  Remove with Component menu, Install Packages menu, deselect Gigasoft and select Remove. 

1) Open Builder and/or click Close All menu item.

2) Use the Open, Project menu item and open "GIGASOFT.CBPROJ" which is located in the c:\ProEssentials10\Builder dir.

3) If planning on developing for Win64 platform, Activate the Win64 target and select Build All Projects.  Activate Win64x target and select Build All.

4) Activate the Win32 target and select Build All Projects 

5) Right Click "Gigasoft.bpl" in the project window and select "Install"  

6) If the Builder IDE happens to be 64bit, then reverse above and activate/build Win32 first and end up building Win64 last and then install.

 

PEGRP64H.DLL

ProEssentials x64 64 bit DLL

PEGRP32H.DLL

ProEssentials x86 32 bit DLL
GIGASOFT.CBPROJ Builder Package
GIGASOFT.CPP Builder CPP helper for VCLs
PEGRPAPI.PAS ProEssentials Constants and Declarations
PEGVCL.PAS Graph Object
PESGVCL.PAS Scientific Graph Object
PE3DVCL.PAS 3D Scientific Graph Object
PEPSVCL.PAS Polar Object
PEPCVCL.PAS Pie Chart Object
PEGRP64H.LIB (modern) Win64x import lib to PEGRP64H.DLL 
PEGRP64H.a (legacy) Win64 import lib to PEGRP64H.DLL
PEGRP32H.LIB Win32 import lib to PEGRP32H.DLL

 

 

The PAS interfaces are compiled and ProEssentials components installed into the "Additional" tab. We provide the PAS source which is far better than providing precompiled bins.


 

Form1... Adding ProEssentials to a Form...

Builder C++ starting result

Click the PEGraph control from the Additional ToolBox and then click and drag a rectangle selection on Form1's canvas. Size the vcl chart control as needed.

 

The adjacent image shows a similar result. 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 (PESGraph1), 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.

 

Unit1.pas...
Use Builder's Object Inspector to add the TForm1 FormShow event handler to the project.

Double clicking OnShow will auto generate this handler.

Builder C++ FormShow


Enter the code as shown below. Try to write a few lines that use enums to see Delphi's intellisense. For example typing PEGraph.PlottingMethod : should prompt the ePlottingMethod enum. If this does not work, or Pegvcl and PEGraph1 is not recognized, the Library Path setting set above likely had a mistake.

PEGraph1->MainTitle = "Hello World";
PEGraph1->SubTitle = "";
PEGraph1->Subsets = 2;
PEGraph1->Points = 6;
PEGraph1->YData[0][0] = 10; PEGraph1->YData[0][1] = 30;
PEGraph1->YData[0][2] = 20; PEGraph1->YData[0][3] = 40;
PEGraph1->YData[0][4] = 30; PEGraph1->YData[0][5] = 50;
PEGraph1->YData[1][0] = 15; PEGraph1->YData[1][1] = 63;
PEGraph1->YData[1][2] = 74; PEGraph1->YData[1][3] = 54;
PEGraph1->YData[1][4] = 25; PEGraph1->YData[1][5] = 34;
PEGraph1->PointLabels[0] = "Jan"; PEGraph1->PointLabels[1] = "Feb";
PEGraph1->PointLabels[2] = "Mar"; PEGraph1->PointLabels[3] = "Apr";
PEGraph1->PointLabels[4] = "May"; PEGraph1->PointLabels[5] = "June";
PEGraph1->SubsetLabels[0] = "For .Net Framework";
PEGraph1->SubsetLabels[1] = "or MFC, ActiveX, VCL";
PEGraph1->YAxisLabel = "Simple Quality Rendering";
PEGraph1->SubsetColors[0] = PEGraph1->PEargb(60, 0, 180, 0);
PEGraph1->SubsetColors[1] = PEGraph1->PEargb(180, 0, 0, 130);
PEGraph1->BitmapGradientMode = false;
PEGraph1->QuickStyle = gLightShadow;
PEGraph1->GraphPlusTable = gGraphPlusTable;
PEGraph1->DataPrecision = gNoDecimals;
PEGraph1->LabelBold = true;
PEGraph1->PlottingMethod = gBar;
PEGraph1->GradientBars = 8;
PEGraph1->BarGlassEffect = true;
PEGraph1->LegendLocation = gLegendLeft;
PEGraph1->DataShadows = gWithThreeD;
PEGraph1->FontSize = gLarge;
PEGraph1->PrepareImages = true;
PEGraph1->CacheBmp = true;
PEGraph1->RenderEngine = gDirect2D;
PEGraph1->AntiAliasGraphics = true;
PEGraph1->AntiAliasText = true;
PEGraph1->AllowDataHotSpots = true;
PEGraph1->PEactions = gReinitAndReset;

 

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

Subsets and Points define the amount of data you'll be passing.

Next, we pass some random data into the YData[s,p] two dimensional property array.

PointLabels[0] sets the first data point label located below axis.

SubsetLabels[0] sets the first subset label.

Next, we set various other properties controlling visual aspects, and enable flicker free updates with PrepareImages.

Finally PEactions is set to gReinitAndReset which tells ProEssentials to initialize and resetimage the image, in other words, you're done setting properties.

Your code window will look similar to below...

 

Results... Congratulations...
Embarcadero Builder C++ charting vcl

Run your project and you'll see the resulting form.

Congratulations, you've just completed your first Builder / ProEssentials implementation.