Using Textures in Graphs

Any object that has an SFX property can use a texture. Set the following properties of the SFX object, when you use a texture:

Saving images

When you use a texture, you must specify an image that is displayed as the texture, in one of the following ways:

If you do not provide an image, then the graph logs an error message and uses the background color instead of a texture.

Example: Setting a background texture for the plot area

The following code specifies a texture for the plot area of a graph. This code assumes that you have a graph that is named myGraph.


// get the SFX object for the plot area SFX plotAreaSFX = myGraph.getPlotArea().getSFX(); // set the image to use plotAreaSFX.setTextureImageURL("http://myServer.myCompany.com/images/bubbles.gif"); // specify that the image should repeat plotAreaSFX.setTextureDisplayMode(BaseGraphComponent.TDM_TILED); // put the texture into effect plotAreaSFX.setFillType(BaseGraphComponent.FT_TEXTURE);