Internet Vision Software
Index : Using Image Maps

../online_help/images/n_admin.gif

An image map allows different hyperlinks to be attached to different areas of an image.

Image maps come in two varieties, Server side and Client Side. Traditionally, Image maps have been Server side, with such techniques as CGI. CFXGraphicsServer uses Client side image maps, which means that all the processing of the map is done by the web browser, rather than the server.

Using CFXGraphicsServer, you can assign a URL to each point in the graph, so that when the user clicks on the graph, he/she is taken to an appropriate page.

The steps to creating such an image map is very simple:

  • Create your tag as normal, specifying any options and additional feature you want.
  • Add the DB_URLSets attribute (For dynamic graphs) or the ST_URLSet{0..} attribute (For static graphs)

The presence of one of these attributes switches on the image map option. Each point in the graph must have a URL, even if it is only blank.

Let us look at an example for when we are using Dynamic Data:

<CFQUERY NAME="gsdata" DATASOURCE="gs">
SELECT data_jan, data_feb, links_jan, links_feb, labels
FROM gphdata
</CFQUERY>

<CFX_GraphicsServer QUERY="gsdata" DB_DATASETS="data_jan, data_feb" DB_URLSETS= "links_jan, links_feb">

Note that each field specified in DB_DataSets has a corresponding field in DB_URLSets.

If we are using Static data, the principle is much the same...

<CFX_GraphicsServer ST_DATASET0="1,2,3,4" ST_DATASET1="1,4,9,16" ST_URLSET0= "http://www.yahoo.co.uk, http://www.bbc.co.uk, ..., ..." ST_URLSET1="..., ..., ..., ...,">

Again, note that each ST_DATASET{0..} field has a corresponding ST_URLSET{0..} field and that they all contain the same number of points.

One more thing worth mentioning is the option to 'Target' your hyperlinks. If you are using frames, then you may want your graph to load the new page into a particular frame. This is done by using the TARGET attribute. Simply set TARGET to the name of the frame you which the hyperlinks to point to.

For example:

<CFX_GraphicsServer ST_DATASET0="1,2" ST_DATASET1="1,4" ST_URLSET0= "http://www.yahoo.co.uk, http://www.bbc.co.uk" ST_URLSET1="..., ...," TARGET="MyFrame">

TARGET
QUERY
ST_URLSET{0..}
DB_URLSETS


Copyright 1999 Internet Vision Software Limited