KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Drawing a simple chart using 4D Chart
PRODUCT: 4D Chart | VERSION: | PLATFORM: Mac & Win
Published On: June 4, 2002
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Compatibility: version 6.7.x and 6.8.x


Drawing a simple chart is very easy to do with 4D Chart. Here is sample code which dynamically draws a column type graph.


All records([Table1])
tableNum:=Table(->[Table1])
categoryField:=field(->[Table1]Field1)
seriesField:=field(->[Table1]Field2)
valuesField:=field(->[Table1]Field3)

vChart:=Open external window(50;50;650;600;8;"Profit Margin Graph";"_4D Chart")
CT SET DOCUMENT SIZE (vChart;586;766)
$err:=CT Chart data (vChart;2;1;0;0;tableNum;categoryField;seriesField;valuesField)



Note: Setting the document size is important when printing this graph. This makes sure that the graph prints on one page and does not spill onto the next page.