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