Back to Home
Visual Graph Home
TriSun Software Inc. Home
Visual Graph Site Menu
What is Visual Graph?
50 Technical Features
Abundant Graphic Libraries
Online Demo (IE Only)
Visual Graph Getting Started
Use VG Component in Delphi 6
Use VG Component in VB6
Use Graphic Library
Change Element's Shape
Make Graphic Button
Get the Selected Elements
Dynamically Create Graph
Use Line Vertexes
Call Windows API Functions
Call Visual Graph Functions
Callback Control Event in Script
Drag Graph in Run Mode
Make and Use Dialog Box
Visual Graph Getting Started - Dynamically Create GraphEach graph has the corresponding description string, so we can use SaveToBuffer() to save a graph to memory by string, also can use LoadFromBuffer() to generate a graph by string.
1. Create a new file in Visual Graph IDE, and then click Table -> New table... menu item to create a table with 2 columns and 3 rows. Now, please fill this table as below:
2. Click Program -> Command line... menu item, input the following script in the Command line window and press <Enter>:
d=AddUnit( 0, "circle" );d.loadfrombuffer(text2.text)
Please note that text2 is the 2nd cell in first row.
Now, a circle will appear in current sheet according to text2.text like this:
3. Input the following script in the Command line window and press <Enter>:
d=AddUnit( 0, "line" );d.loadfrombuffer(text4.text)
Please note that text4 is the 2nd cell in second row.
Now, a graph will appear in current sheet according to text4.text like this:
4. Input the following script in the Command line window and press <Enter>:
d = AddUnit( 0, "traffic lights" ); d.LoadFromBuffer( text6.text )
Please note that text6 is the 2nd cell in third row.
Now, the traffic lights will appear in current sheet according to text6.text like this:
5. Refer to this example, we can save graph's description string in file or database, once we need one, just simply call LoadFromBuffer() to generate it by using its description string.
Legal Notices |
Contact Us |
Copyright© 2004-2017 TriSun Software Inc. All rights reserved.