Instantiating a PopChart Embedder Object

The next step is to instantiate, or create, a PopChart Embedder object.

Note: For those of you unfamiliar with the concepts behind object-oriented programming, you may find it helpful to read a quick primer on it, but you can probably get through this chapter by just "winging it."

To instantiate a PopChart Embedder object in JavaScript, you first need to decide on a name for your object. The name is for programming purposes only—it will have no effect on the final image. Throughout most of this documentation, we choose the name myPopChart.

Then, we would use the following line to instantiate the object:

myPopChart = new PopChartEmbedder();

Of course, if you want to use a name other than myPopChart, you should change this line accordingly.

So, thus far, you should have inserted the following code into the web page:

Example 4.2 Example Code After Instantiating a PopChart Embedder Object

<script language="JavaScript1.2" src="http://localhost:2001/jsEmbedder"></script> 

 

<script language="JavaScript1.2"> 

<!-- // Embedding a PopChart Image 

 

   myPopChart = new PopChartEmbedder(); 

 

// Finished Embedding --> 

</script>