Graph Example

Graph Example #1


This page shows a graph generated by JS Graph. Below is the code for this page, showing all that is required to generate the graph using the JSGraph object library "jsgraph.js".
<html><head><title>Test JSGraph Object</title>
<script language="JavaScript1.2" src="jsgraph.js"></script>
<script language="JavaScript1.2">
<!--

var graph = new JSGraph();
graph.verticalBarGraph();
graph.lightSource('SW');
graph.yAxis(4, 200);
graph.xAxis(4, 200);
graph.yAddTicks(10, '#000000', 2);
graph.xAddTicks(10, '#000000', 2);
graph.addTrellis(40,1);
graph.yAddText('Times Per Year','tahoma,sans-serif','#FF0000',10);
graph.yTextNudgeDown(15);
graph.xAddText('Power Level','tahoma,sans-serif','#0000FF',10);
graph.addBackground('#FFF8DC');
graph.addBar('c',30,12,'#FF0000');
graph.addBar('a',50,12,'#00FF00');
graph.addBar('s',178,12,'#0000FF');
graph.addBar('x',200,12,'#000000');

//-->
</script>
</head>
<body>
<div id="JSGraphHolder_1" style="display:block;position:absolute;top:20px;left:50px;
     width:450px;text-align:center;">
<b>Large Graph Example</b>
</div>
<div id="autoH" style="position:absolute;top:50px;left:100px;margin: 0px 0px 0px 0px;
      padding: 0px 0px 0px 0px;">
<script language="JavaScript">
<!--
graph.makeGraph();
//-->
</script>
</div>


</body>
</html>




Hosted by www.Geocities.ws

1