How to use Google Charts with 4D
According to neuroscientists, we respond better and faster to a visual form than any other type of representation. That’s why graphs and charts are clearly a key to a better understanding of data.
So if you’re looking to display bar charts, histograms, or pie charts which are modern and fully compatible with the leading browsers, but also more suitable for the way the human brain processes information, Google Charts is one possible answer. The available chart types in Google Charts is varied: from the classical bar/column/pie charts, Google Charts also offers elaborated graphs such as Treemap, Candlestick and Gauge charts.
Retrieve the license information by programming
When you perform analysis, reporting or debugging of your server application you may want to know the number of available clients, the number of consumed connections, the expiration date and many other information.
Now with 4D v16 R4, you can retrieve detailed information about the active license of your running 4D product (4D Server for instance). For example:
- version,
- platform,
- number of available and consumed connections for 4D Write Pro,
- number of available and consumed connections for 4D Client,
- expiration date,
- …
Define the tab order by programming
Here are 2 very common developer needs: 1. Depending on the user criteria, you want to rearrange the objects in the form. – 2. Depending on the selected item in a list, you want to show, hide or move the objects in the form.
In all theses cases, you need to change the tab order of the form objects. Now in 4D v16 R4, you can modify the tab order at runtime by programming. To do so, 2 new commands have been created: FORM SET ENTRY ORDER and FORM GET ENTRY ORDER.
Support of pictures in Objects
From 4D v16 R4, we have added the support of pictures in object attributes. For example, if you use an object to exchange settings or data between methods, forms or processes, now, you can also pass an icon or a picture in this object. You don’t need anymore to temporarily save the picture on disk.
This new type can be used like any other object attribute type: you can use, get and set pictures in objects. You can also use the controls of the picture theme.
Validate your JSON object
We use more and more the JSON format. For example, to save settings in a file, to store software configuration, or to exchange client-data on the web with other servers.
How can you validate that the received data is in the expected format? How can you validate that all the necessary information is actually present? How can you do this validation without writing a tiresome method for each type of JSON format?
Simply by writing a JSON schema and use the JSON Validate new command!
Discover how object notation can simplify your developer’s life!
With the object notation, available as a preview in 4D v16 R4, your code is simpler to write, easier to read and more natural to think. That is true. But did you really see the full potential of the object notation?
Before 4D v16 R4, when you wanted to create a detail form to enter contact information from an object field, you had no choice but to write an expression like OB GET ([CONTACT]Info; “City”) in the variable data source. You could retrieve the attribute value, but it was not possible to change it. Moreover, you had to write a loadRecord method with the OB GET command for each attribute and a saveRecord method with the OB SET command for each attribute.
What does object notation change in this scenario? From 4D v16 R4, you just write [CONTACT]Info.City in the variable data source! This variable is available in Read/Write mode. OB GET and OB SET commands are no longer necessary. That’s it! Now you see the full potential.
Another way of coding: Object notation
Objects are great, everyone says so. Beside their wonderful flexibility, they are unbelievably fast. You can search through millions of records in just a fraction of a second. 4D v16 even allows to order by object attributes, and to do calculations such as Sum or Average.
With 4D v16 R4, the 4D language has been drastically enhanced to make the usage of objects much more comfortable – with the support of the object notation. Fast, flexible, efficient and now elegant!
Create your own contextual menu for 4D Write Pro
4D gives you new possibilities to customize your 4D Write Pro user interface to make it perfectly fit your business application. Instead of using the default 4D Write Pro contextual menu, which is so detailed that it could become unpleasant to use, the 4D developer can create its own contextual menu, with the exact list of actions that he wants to provide.
More standard actions for Styled Text areas
You want to quickly create a toolbar for your Styled text areas. You want to change the font of the text or compute/freeze 4D Expressions without writing a line of code. It is possible using the new standard actions for Styled Text areas.
Just associate a standard action to each button object and 4D will handle everything automatically: action triggering but also the button activation or deactivation if the action is not available in the current context.
Export results of “Find in design” dialog
When you search for all objects in the Design Environment, 4D displays the results in the hierarchical list. From 4D v16 R3, you can export these results in a text file that can be opened using a spreadsheet for example, so that you can easily dispatch some refactoring work or store the results in a document to work on it later.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy