[42] | 1 | <html> |
---|
| 2 | <body> |
---|
| 3 | |
---|
| 4 | <?php |
---|
| 5 | $_graphfilename = 'csim_in_html_graph_ex1.php'; |
---|
| 6 | // This is the filename of this HTML file |
---|
| 7 | global $_wrapperfilename; |
---|
| 8 | $_wrapperfilename = basename (__FILE__); |
---|
| 9 | |
---|
| 10 | // Create a random mapname used to connect the image map with the image |
---|
| 11 | $_mapname = '__mapname'.rand(0,1000000).'__'; |
---|
| 12 | |
---|
| 13 | // This is the first graph script |
---|
| 14 | require_once ($_graphfilename); |
---|
| 15 | |
---|
| 16 | // This line gets the image map and inserts it on the page |
---|
| 17 | $imgmap = $graph->GetHTMLImageMap($_mapname); |
---|
| 18 | echo $imgmap; |
---|
| 19 | |
---|
| 20 | ?> |
---|
| 21 | |
---|
| 22 | <h2>This is an example page with CSIM graphs with arbitrary HTML text</h2> |
---|
| 23 | |
---|
| 24 | <?php |
---|
| 25 | if( empty($_GET['clickedon']) ) { |
---|
| 26 | echo '<b style="color:darkred;">Clicked on bar: <none></b>'; |
---|
| 27 | } |
---|
| 28 | else { |
---|
| 29 | echo '<b style="color:darkred;">Clicked on bar: '.$_GET['clickedon'].'</b>'; |
---|
| 30 | } |
---|
| 31 | echo '<p />'; |
---|
| 32 | ?> |
---|
| 33 | |
---|
| 34 | <p>First we need to get hold of the image map and include it in the HTML |
---|
| 35 | page.</p> |
---|
| 36 | <p>For this graph it is:</p> |
---|
| 37 | <?php |
---|
| 38 | |
---|
| 39 | // The we display the image map as well |
---|
| 40 | echo '<pre><b>'.htmlentities($imgmap).'</b></pre>';?> |
---|
| 41 | |
---|
| 42 | <?php |
---|
| 43 | // Construct the <img> tag and rebuild the |
---|
| 44 | $imgtag = $graph->GetCSIMImgHTML($_mapname,$_graphfilename); |
---|
| 45 | ?> |
---|
| 46 | <p>The graph is then be displayed as shown in figure 1. With the following |
---|
| 47 | created <img> tag:</p> |
---|
| 48 | <pre><b> |
---|
| 49 | <?php echo htmlentities($imgtag); ?> |
---|
| 50 | </b></pre> |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | <p> |
---|
| 54 | <?php |
---|
| 55 | echo $imgtag; |
---|
| 56 | ?> |
---|
| 57 | <br><b>Figure 1. </b>The included CSIM graph. |
---|
| 58 | </p> |
---|
| 59 | |
---|
| 60 | </body> |
---|
| 61 | </html> |
---|