|
Image Maps on Financial Charts? |
Posted by Paul Brendea on Jul-07-2005 18:53 |
|
Is it possible to implement Image Maps on Financial Charts? What I want is: when dragging the mouse over the chart line, to appear near the mouse pointer a label in which is indicated the date/time, price or other indicators. |
Re: Image Maps on Financial Charts? |
Posted by Peter Kwan on Jul-08-2005 00:52 |
|
Hi Paul,
Yes. You may add image maps for financial charts like adding image maps to any other chart type. The exact method depends on your development system and programming language.
For example, in ASP.NET/VB.NET, you may use the following code to add image maps to the output:
'put the following line after the viewer.Image = .... line
viewer.ImageMap = m.getHTMLImageMap("", "", "title='" & m.getToolTipDateFormat() & " {value|G}'")
If you need further help, please let me know which programming language you are using.
Regards
Peter Kwan |
Re: Image Maps on Financial Charts? |
Posted by Paul Brendea on Jul-08-2005 15:59 |
|
Thank you, Peter, for your quick answer.
We are using PHP language, with MySQL Database.
So, I understand that Image Maps can be user defined, in any style we want. If that's correct, please let me know how we can do that.
Paul |
Re: Image Maps on Financial Charts? - completion |
Posted by Paul Brendea on Jul-08-2005 16:36 |
|
Hi Peter
I forgott to mention that we are using the Finance Chart. You can see here a sample temporary implemented in our web site: http://www.primet.ro/ChartDirector/financedemo.php
Paul |
Re: Image Maps on Financial Charts? - completion |
Posted by Peter Kwan on Jul-08-2005 21:18 |
|
Hi Paul,
You just need to output the image map to the browser in addition to the image. There are many methods to output things to the browser. If you do not want to modify your existing code structure too many, I think the easiest method is to use IFRAME to output both the chart image and the image map.
In your origincal code, you should have a line like:
<IMG id="ChartImage" align=top border=0>
Please change it to:
<IFRAME WIDTH='800' HEIGHT='600' FRAMEBORDER="No" SCROLLING="No" id="ChartImage">
(Note: You may adjust the WIDTH and HEIGHT to the actual width and height of your chart.)
Then in "financechartdemo.php", the original sample code uses directly streaming to output the image:
header("Content-type: image/png");
print($c->makeChart2(PNG));
Please change the above code to:
$chart1URL = $c->makeSession("chart1");
$imageMap = $c->getHTMLImageMap("", "", "title='".$c->getToolTipDateFormat()." {value|G}'");
Then add the following at the end of the "financechartdemo.php" page:
<html>
<body leftMargin=0 topMargin=0>
<img src="myimage.php?<?php echo $chart1URL?>" border="0" usemap="#map1">
<map name="map1">
<?php echo $imageMap?>
</map>
</body>
</html>
I have attached the complete sample code for your reference.
Regards
Peter Kwan
|
Re: Image Maps on Financial Charts? - completion |
Posted by Paul Brendea on Jul-09-2005 20:22 |
|
Thank you, Peter!
Your answers were really helpful, in fact you can see the result here: http://www.primet.ro/ChartDirector/financedemo.php.
I appreciate your profesionalism and your quick replies. Henceforth, I hope to find in this forum a good assistance, as I found till now.
Paul |
|