Chapter 4
This chapter discusses the API for the PopChart Embedder.
The PopChart Embedder is a utility that simplifies the process of embedding a PopChart image into a web page. It is available in the following formats: Java, JavaBean, JavaScript, .NET, PHP, and COM (Component Object Model). It can be used in a variety of environments, including Java Server Pages, Active Server Pages, ASP.NET, Java Servlets, and ColdFusion.
The programming interface for the PopChart Embedder is essentially identical for all of the languages and environments mentioned above. Thus, except where there is an obvious difference in the way the PopChart Embedder behaves in a certain language or environment, this chapter makes no distinction between the various flavors of the PopChart Embedder.
Note: In versions of the PopChart Server prior to the 4.0 release, the PopChart Embedder APIs were not consistent. In order to bring about this consistency, many methods have been deprecated. For more information, refer to "Deprecated Methods".
To simplify the examples in this chapter, we rely mostly on Java coding conventions, but the equivalent C++ code should be fairly obvious. For example, most of the attributes are listed as type String, which, of course, should be type string (lower-case) in C++ or C#. You can also use a wide character array (w_char*) in place of String.
Likewise be aware that Active Server Pages use VBScript, which requires you to not have a semi-colon at the end of each line of code. Be sure to remove semi-colons from any example code that you use. It also requires any functions that do not return a value (void methods) to not have parenthesis around the parameters.
For example, we show the addHTMLTable() syntax to be:
myPopChart.addHTMLTable("graph","title");
This is perfectly valid in every language except VBScript. So in ASPs, you would need to use the following syntax:
myPopChart.addHTMLTable "graph", "title"
For most ASP developers this will be an obvious conversion process.
Finally, in PHP, you will always use pointer notation when calling methods or accessing attributes. Also, variable names must always begin with a dollar sign. For example, consider the following command in Java.
myPopChart.appearanceFile = "bar.pcxml";
The equivalent code in PHP would be as follows:
$myPopChart->appearanceFile = "bar.pcxml";
Again, for most PHP developers, this will be an obvious conversion process.