WebSmart Code Samples
 

How this program was created.

  1. Select the "A Simple Page" template
  2. Choose the wizard defaults.
  3. Add file XL_WEBDEMO/MU_ORDHF
  4. Download the graph javascript file from this location: Graphs.zip
    This must be unpacked and the graphs.js file placed on your IFS in folder esdi/websmart/javascript/
  5. In the PML:
    1. Add a workfield called selstring which is 256 Alpha
    2. Add a workfield called atotal which is 10 Alpha
    3. Add a workfield called ordtot which is 9, 2 Numeric
    4. Add a workfield called month which is 2, 0 Numeric
    5. Add the function monthvalues taken from this PDW. This function grabs the data used to create the graph
  6. In the HTML:
    1. Add the javascript into the HTML by adding the following line of code into the HEAD portion of MainSeg:
      < script language="JavaScript" type="text/javascript" src="/websmart/javascript/graphs.js">< /script>
      Note: Spaces were added for display purposes. You can copy and paste the correct code from this PDW
    2. Add the javascript function that creates the graph:
      < script language="JavaScript">
      graph = new BAR_GRAPH("vBar");
      graph.values = "< func name="monthvalues">";
      graph.labels = "Jan.,Feb.,Mar.,Apr.,May,Jun.,Jul.,Aug.,Sep.,Oct.,Nov.,Dec.";
      document.write(graph.create());
      < /script>

      Note: Spaces were added for display purposes. You can copy and paste the correct code from this PDW
  7. Compile the program and your done!


  This example was created using WebSmart.

www.excelsystems.com