This function generate an instance of the given data representation-type (e.g. it will generate an instance of Image_Graph_Data_Line if you supply "line" for $representation). The new object will automatically be added to an internal list of data-objects. A reference to the object which was added to the graph will also be returned by this function. Using that reference you can e.g. call functions like setColor(), or whatever the specific data-element might support, to customize the data-element. You can use the array $attributes to supply attribute-data to the data-element upon creation. This might be quite handy if you add several data and don't want to call e.g. setColor() on each one separately. But this is up to you ... If no "color" is specified in the attributes-array, the "dataDefaultColor" will be used, which can be set using setDataDefaultColor().
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?