ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  getHTMLImageMap on xAxis
Posted by Adrian Groves on Feb-06-2013 23:18
Hi there,

After calling makesession(), I have a chart with an image map, and I am getting the <AREA>
details by calling getHTMLImageMap on the chart object. I am passing in a blank value for
the URL (1st parameter) so that I dont get an HREF in the HTML generated, but just show a
TITLE.

However, if I call getHTMLImageMap on the xAxis object, I only get the <AREA> text
returned if I supply something into the 1st parameter. If I leave the first parameter blank,
no text is returned !

Why would this differ when calling getHTMLImageMap for the chart object, which works OK
?

  Re: getHTMLImageMap on xAxis
Posted by Peter Kwan on Feb-07-2013 02:36
Attachments:
Hi Adrian,

I have just tried myself by adding Axis.getHTMLImageMap to the "Simple Bar Chart" sample code, and it works normally. May be you can try the attached code to see if it works in your case. If the attached code works, and in your own code it does not work, is it possible to create an example using your own code? (If you cannot attach your code in this forum, you may email me at pkwan@advsofteng.net.) I may need to exact details to troubleshoot the issue.

Regards
Peter Kwan
simplebar.jsp
<%@page import="ChartDirector.*" %>
<%
// The data for the bar chart
double[] data = {85, 156, 179.5, 211, 123};

// The labels for the bar chart
String[] labels = {"Mon", "Tue", "Wed", "Thu", "Fri"};

// Create a XYChart object of size 250 x 250 pixels
XYChart c = new XYChart(250, 250);

// Set the plotarea at (30, 20) and of size 200 x 200 pixels
c.setPlotArea(30, 20, 200, 200);

// Add a bar chart layer using the given data
c.addBarLayer(data);

// Set the labels on the x axis.
c.xAxis().setLabels(labels);

// Output the chart
String chart1URL = c.makeSession(request, "chart1");

// Include tool tip for the chart
String imageMap1 = c.getHTMLImageMap("", "", "title='{xLabel}: US${value}K'")
	+ c.xAxis().getHTMLImageMap("", "", "title='X Axis Label: {label}'");
%>
<html>
<body style="margin:5px 0px 0px 5px">
<div style="font-size:18pt; font-family:verdana; font-weight:bold">
    Simple Bar Chart
</div>
<hr color="#000080">
<div style="font-size:10pt; font-family:verdana; margin-bottom:1.5em">
    <a href="viewsource.jsp?file=<%=request.getServletPath()%>">View Source Code</a>
</div>
<img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'
    usemap="#map1" border="0">
<map name="map1"><%=imageMap1%></map>
</body>
</html>