JARS top 25%

Horace's Java
Gauge Demo

THIS IS NOT A COUNTER SERVICE - you are welcome to grab a copy of the applet below for non-commercial use on your own data source - but PLEASE don't load this applet from my site into your page - it won't work that way any more anyway. - Thanks!

USAGE NOTE 3-24-98: It looks like some folks have been just letting this demo run for hours and hours and hours ... which, coupled with the number of folks viewing the demo, was causing problems on the server. So I had make a few minor changes...

  1. Added a little code to the applet to limit the length of time it will run for any particular visitor. I've currently set this for @ 10 minutes using the current speed parm setting of the demo.
  2. Added some code that will allow me to tell the applet to actually stop so that I can sort of "bump" the applet if too many folks have it running at once. So if you get bumped - sorry.

The Applet

<applet codebase="http://www.hav.com/java/gauge/"
code=CounterGauge.class id=CounterGauge name="LargeGauge"
height="80" width="142" alt="JAVA Gauge">
<param name=dataSource value="http://www.hav.com/java/gauge/nph-getcount.htm?EHPH">
<param name=gaugeTitle value="Estimated Server Hits / Hr.">
<param name=gaugeRadius value="50">
<param name=maxValue value="3000">
<param name=minValue value="0">
<param name=warnValue value="2500">
<param name=speed value="5">
<param name=bgColor value="000070">
<param name=faceColor value="0000a0">
<param name=textColor value="ffffff">
<param name=valueColor value="ffff00">
<param name=warnColorON value="00ff00">
<param name=warnColorOFF value="0000c0">
</applet>

The Applet

<applet codebase="http://www.hav.com/java/gauge/"
code=CounterGauge.class id=CounterGauge1 name="SmallGauge"
height="70" width="90" alt="JAVA Gauge">
<param name=dataSource value="http://www.hav.com/java/gauge/nph-getcount.htm?CVIS">
<param name=gaugeTitle value="Cur Visitors">
<param name=gaugeRadius value="30">
<param name=maxValue value="20">
<param name=minValue value="0">
<param name=warnValue value="-1">
<param name=speed value="5">
</applet>

Other Java Demos & Stuff

Don't forget to drop by and take a look at the other hav.Software Java Stuff - demos and products like chat, live gauges, stripcharts, rolling reports, neural net libraries, etc.

Note on PROXIES

Because this demo needs to access a file on my server in order to obtain new data on a continuous basis - and because the current security model of a Java applet does not allow it to open a URL except on the server from which the applet originated - this demo may not (read "probably won't") work if you're behind a proxy server.

This is just a little demo that illustrates the combined use of JAVA and NeoWebScript to produce running monitor of the current value of one (or more) NeoWebScript Named Counters.

The applet takes several parameters:

  • dataSource: The URL of the source of data to be displayed. REQUIRED

    USAGE NOTE: This demo uses a NeoWebScript as a cgi to deliver data; however, you can use any CGI that delivers a single integer (as a string) value when called (see the get_data() function in the applet).

    Arguments to my script include any of the following:

    • the named counter (or counters - each seperated by "&") to be displayed (not shown above)
    • "EHPH" - a special value for Estimated Hits Per Hour (top left chart)
    • "CVIS" - a special value for the Estimated Number of Current Visitors around a NeoTracked site (top right chart)

    Named counters are a feature of NeoWebScript and will not make sense for other servers; however, you can use any cgi to deliver new data from whatever source makes sense for your application (see the get_data() function).

  • gaugeTitle: the gauge's title (displayed below the gauge itself Default: ""

  • gaugeRadius: the Radius of the gauge (in pixels) Default: 50

  • maxValue: the maximum value shown on the gauge (Right scale) Default: 100

  • minValue: the minimum vaue shown on the gauge (Left scale) Default: 0

  • warnValue: the value at which the gauge shows a warning section (red) - this value should be greater than minValue and less than maxValue. A value >= minValue OR <= maxValue means to NOT SHOW the warning section (see top right).
    Default: 90% of (maxValue - minValue)

    USAGE NOTE: If you set the warnValue small enough that the warnValue's Label appears on the LEFT of the gauge, this may cause the width of the applet to be changed in order to push things to the RIGHT.

  • bgColor: the main applet background color (form: "ffffff") Default: white

  • faceColor: the gauge's face color (form: "ffffff") Default: white

  • textColor: the main text color (min, max) and the gauge's outline color (form: "ffffff")
    Default: black

  • valueColor: the color of the value slice (< warnValue) (form: "ffffff") Default: blue

  • warnColorON: the color of the warn slice area where value > warnValue (form: "ffffff")
    ALSO, the color of the warn slice outline and label
    Default: red

  • warnColorOFF: the color of the warn slice where value < warnValue (form: "ffffff")
    Default: lightGray

  • speed: the time in SECONDS between data retrieval attempts Default: 5

USAGE NOTE: if you place the applet in a table, it may not be able to resize as needed to fit your selections for chart size. To ensure that you will see the applet as intended, consider the following in sizing your applet's width and height attributes:

  • this version uses a font size of 12 for all text
  • applet width will be about 1/2 width minValue + 1/2 width maxValue + (2 * gaugeRadius) pixels wide
  • applet height will be about gaugeRadius + (2 * charHeight) + 3 pixels tall


sources for:
the Applet
this HTML page
this demo's data retrieval mechanism

NOTE: if you're not running on a NeoWebScript/Apache server, or if you want to display some other value, then you'll need to write your own cgi or whatever to provide the data to be displayed.

Search the Site
Home
http://www.hav.com/
Find Any or All of

http://www.hav.com/
  
Questions?
Feel free to drop by and chat if you have any questions - one of us is usually around during normal CST/CDT business hours.


hav.Software

Copyright © -1995-2017 by hav.Software. All Rights Reserved.

http://www.hav.com/ havBpNet:J, havFmNet:J, havBpNet++, havFmNet++, havBpETT, havCNet, WebSnarfer, havIndex and havChat are all trademarks of hav.Software.

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.

There may be other trademarks or tradenames listed in this document to refer to the entities claiming the marks and names or products. hav.Software disclaims any proprietary interest in any trademark, tradename or products other than its own.


hav@hav.com
Modified - 06/06/03 - 31709995 - 6714038