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

Message ListMessage List     Post MessagePost Message

  tooltips finance chart
Posted by Gerard Isdel on May-05-2009 17:45
Hi

I have a question about tooltips and the finance chart example.

I have modified the financedemo code to product tooltips using the getHTMLImageMap.


in financedemo.php
# create the finance chart
$c = drawChart();
$chart=$c->makeChart2(PNG);
$_SESSION['imageMap']=$c->getHTMLImageMap("clickable", "","title='{x}: {value} DataSet {dataSet} DatasetName {dataSetName} '");
# Output the chart
header("Content-type: image/png");
print($chart);


and in financedemochart.php
<img id="ChartImage" align="top" border="0" usemap="#map1">
<map name="map1">
<?php
echo $_SESSION['imageMap'];
?>
</map>

The code works fine the firsttime, and the correct imagemap is created.  However when I use the click update chart, obviously only the image gets called again and the imagemap is out of date.

Is there a way to modify the code, so that a new imagemap is sent to the browser at the same time as the new image is requested.

Gerard

  Re: tooltips finance chart
Posted by Peter Kwan on May-06-2009 01:21
Attachments:
Hi Gerard,

There are some discussion in the following thread on how to modify the Interactive Financial Chart sample code to include tooltips. There are also is example attached but it is in PHP:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1120733629#N1120828686

I have just modified the example to JSP as attached, (Note: the example is based on ChartDirector Ver 4, but the method is the same in ChartDirector Ver 5).

Hope this can help.

Regards
Peter Kwan
finance_clickable_jsp.zip
finance_clickable_jsp.zip

8.05 Kb

  Re: tooltips finance chart
Posted by jayjay on Feb-11-2011 12:18
Hi Peter,

I tried your code, but the chart did not show up. Any more suggestion?

Thanks,
JayJay

  Re: tooltips finance chart
Posted by Peter Kwan on Feb-12-2011 06:41
Hi jayjay,

Have you included "getchart.jsp" in the same directory as the JSP files? (Like all ChartDirector for JSP/Java sample code that has tooltips, the file "getchart.jsp" should be in the same directory as the running JSP file.)

If the above still does not solve the problem, would you mind to inform me what is the error message? If you see a broken image symbol (like a "red X"), please inform me what is the error message inside the "red X". See the followings if you are not aware how to read the error message:

http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200

Regards
Peter Kwan

  Re: tooltips finance chart
Posted by jayjay on Feb-12-2011 12:13
Hi Peter,

Thanks a lot. I unzipped your code into a folder and run from there and forget to copy
getchart.jsp to there. It works now.

Jayjay