Bar Field          
  
   
 


A Bar Graph field

Parameters

  • title
  • id
  • width
  • height
  • maxValue
  • value
  • tile - optional bar tile image
  • suffix - optional value suffix string

Usage:

[{BarField title="My Bar" id="myBar" width="400" height="30" maxValue="100" value="13"}]
My Bar

My Bar

My Bar

Animate Bar


renderer.sjs

var title = extension.getAttributeValueByName("title"); var id = extension.getAttributeValueByName("id"); var value = extension.getAttributeValueByName("value"); var maxValue = extension.getAttributeValueByName("maxValue"); var width = extension.getAttributeValueByName("width"); var height = extension.getAttributeValueByName("height"); var barImage = extension.getAttributeValueByName("tile"); var suffix = extension.getAttributeValueByName("suffix"); if(title!=null && id!=null) { if(barImage==null) { barImage = "/OpenForum/Extensions/BarField/yellow-bar.png"; } if(suffix==null) { suffix=""; } data = "<table class=\"blog\"><tr><td>"+title+"</td><td height=\""+height+"\" width=\""+width+"\""; data += "bgcolor=\"white\"><img id=\""+id+"Bar\" src=\""+barImage+"\" "; data += "width=\"5\" height=\""+height+"\"><input type=\"hidden\" id=\""+id+"Field\""; data += "name=\""+id+"Field\"></td><td><DIV id=\""+id+"Layer\"></DIV></td></tr></table>"; data += "<script>"; data += "includeLibrary(\"/OpenForum/Extensions/BarField/barField.js\");"; data += "includeInitFunction(\""+id+" = new BarField(\'"+id+"\',"+value+","+maxValue+","+width+",\'"+suffix+"\')\")"; data += "</script>" return data; } else { return "Invalid Tag. Missing title or id attribute."; }
by NikCross on 21/04/2008 at 10:08 PM