Chart FX for Java is able to generate Image Maps for charts generated as images. Image Maps are commonly used for providing DrillDown capabilities in image charts. Also, image maps are
useful for showing ToolTips in image charts, even without using Chart FX
for Java's DrillDown capabilities.
DrillDown charts will be functional even when Chart FX for Java generates
images (PNG or JPEGs). This way your original site functionality will not be
lost when Chart FX for Java can't provide active client-side components to
the browser or if you have decided that Chart FX for Java will always generate images.
Before you read this topic, please make sure you understand how to setup drill
down capabilities for the charts. For more information please refer to the DrillDown Capabilities section.
When Chart FX for Java is producing an image and the DrillDown
capabilities are enabled in the code, Chart FX for Java will generate a
client-side Map with the location of the different markers in the resulting
image.
These maps may be quite large depending on the number of points and series you
have in your chart. Therefore, you must be aware that generating Image Maps
could represent a work overload on your server. Please note that the number of lines
in the image map depends on the number of markers in your chart,
e.g. a 3D bar chart with 2 series and 10 points will generate an image map with
2*10*3 objects. (3 polygons are required to paint a 3D bar chart)
The resulting image map has the following characteristics:
- It is embedded in the resulting page. External image maps are not supported.
- It is a client side image map. This means the browser is responsible for processing the mouse position.
- You can control how to generate the Title attribute in the AREA tags with the ImgMap property.
IMPORTANT NOTE: Image Maps are not supported for Curve charts or
when you are using the BitStream chart generation
capability of Chart FX for java.
How are parameters appended to the actual link in the image map?
The answer to this question can be found in the DrillDown Capabilities
section. Basically, the URLParamMask property specifies a mask that will be used to append parameters to
the page that is being called as a result of a click in an AREA pointed by the
Image Map. For example, if you setup the code as follows:
chart1.setURL("DrillParam.jsp"); chart1.setURLOptions(URLFlag.JUMP); chart.setURLParamMask("Series=%s&Value=%v);
|
Then the Image Map will be generated with a link like:
DrillParam.jsp?Series=1&Value=30.6
|
IMPORTANT NOTE:Chart FX for Java handles escaping its own strings
(+ instead of space). Therefore, you don't have to worry about encoding the
URLParamMask. In other words, when you invoke a page with parameters that
contains blank spaces you must replace blank spaces with + signs; this can be
done through URL Encoding. Chart FX for Java, however, does this for you in
case you're passing a string that contains spaces.
Can I control ToolTips that are shown in the chart?
The TipMask property allows you to configure the text that is
to be shown when the user positions the mouse over a particular element in the
chart that belongs to the Image map. However, because browsers support ToolTips
in a different way, Chart FX for Java provides the ImgMap property which
allows you to control how the ToolTip will appear; it takes one of the
following settings:
ImgMap.TitleTip
If you are displaying your charts on Internet Explorer 3.0 and above, the
ToolTip will be displayed with the contents of the TITLE attribute. Therefore,
when you set the ImgMap property to this setting it will show the ToolTip in
Internet Explorer. This feature is not supported by Netscape but looks great in
Internet Explorer.
ImgMap.MouseTip
If you want to achieve browser independence for displaying ToolTips you can
set the ImgMap property to this setting which allows you to invoke a javascript
to show the ToolTip on any browser. It will add the following function calls to
the AREA tag:
onmouseover="popupon('<ToolTip>',event)": this function will be called when the mouse passes over the Image Map area.
onmouseout="popupoff()": this function will be called when the mouse abandons the Image Map area.
You will be responsible for the implementation of these functions. For
further details on how to implement a browser independent displaying ToolTips
see the following sample.
For example, if you want to show ToolTips in all browsers you can setup your jsp code as follows:
ChartServer chart1 = new ChartServer(application,request,response);
chart1.setImgMap(ImgMap.MOUSE_TIP);
chart1.setURL("DrillParam.jsp");
|
IMPORTANT NOTE: Annotation Tools with the URL property will also
have its corresponding Image Map. This way you can link using chart
elements and annotation objects in your chart.
|