// THIS FILE HAS BEEN MINIFIED

if(typeof(RGraph) == 'undefined') RGraph = {};RGraph.Odometer = function (id, start, end, value)
{
this.id = id
this.canvas = document.getElementById(id);this.context = this.canvas.getContext('2d');this.canvas.__object__ = this;this.type = 'odo';this.isRGraph = true;this.start = start;this.end = end;this.value = value;RGraph.OldBrowserCompat(this.context);this.properties = {
'chart.value.text':             false,
'chart.needle.color':           'black',
'chart.needle.thickness':       2,
'chart.needle.head':            true,
'chart.needle.tail':            true,
'chart.needle.type':            'pointer',
'chart.text.size':              10,
'chart.text.color':             'black',
'chart.text.font':              'Verdana',
'chart.green.max':              end * 0.75,
'chart.red.min':                end * 0.9,
'chart.green.color':            'green',
'chart.yellow.color':           'yellow',
'chart.red.color':              'red',
'chart.label.area':             35,
'chart.gutter':                 25,
'chart.title':                  '',
'chart.title.vpos':             null,
'chart.contextmenu':            null,
'chart.linewidth':              1,
'chart.shadow.inner':           false,
'chart.shadow.outer':           false,
'chart.annotatable':            false,
'chart.annotate.color':         'black',
'chart.scale.decimals':         0,
'chart.zoom.factor':            1.5,
'chart.zoom.fade.in':           true,
'chart.zoom.fade.out':          true,
'chart.zoom.hdir':              'right',
'chart.zoom.vdir':              'down',
'chart.zoom.frames':            10,
'chart.zoom.delay':             50,
'chart.zoom.shadow':            true,
'chart.zoom.mode':              'canvas',
'chart.zoom.thumbnail.width':   75,
'chart.zoom.thumbnail.height':  75,
'chart.zoom.background':        true,
'chart.zoom.action':            'zoom',
'chart.resizable':              false,
'chart.units.pre':              '',
'chart.units.post':             '',
'chart.border':                 false,
'chart.tickmarks.highlighted':  false,
'chart.zerostart':              false,
'chart.labels':                 null
}
if(typeof(RGraph) == 'undefined'){
alert('[ODO] Fatal error: The common library does not appear to have been included');}
}
RGraph.Odometer.prototype.Set = function (name, value)
{
if(name == 'chart.needle.style'){
alert('[RGRAPH] The RGraph property chart.needle.style has changed to chart.needle.color');}
this.properties[name.toLowerCase()] = value;}
RGraph.Odometer.prototype.Get = function (name)
{
return this.properties[name.toLowerCase()];}
RGraph.Odometer.prototype.Draw = function ()
{
RGraph.FireCustomEvent(this, 'onbeforedraw');this.radius = Math.min(this.canvas.width / 2, this.canvas.height / 2) - this.Get('chart.gutter') - (this.Get('chart.border') ? 15 : 0);this.diameter = 2 * this.radius;this.centerx = this.canvas.width / 2;this.centery = this.canvas.height / 2;this.range = this.end - this.start;this.context.lineWidth = this.Get('chart.linewidth');this.DrawBackground();this.DrawLabels();this.DrawNeedle();if(this.Get('chart.contextmenu')){
RGraph.ShowContext(this);}
if(this.Get('chart.annotatable')){
RGraph.Annotate(this);}
if(this.Get('chart.zoom.mode') == 'thumbnail' || this.Get('chart.zoom.mode') == 'area'){
RGraph.ShowZoomWindow(this);}
if(this.Get('chart.resizable')){
RGraph.AllowResizing(this);}
RGraph.FireCustomEvent(this, 'ondraw');}
RGraph.Odometer.prototype.DrawBackground = function ()
{
this.context.beginPath();if(this.Get('chart.shadow.outer')){
RGraph.SetShadow(this, '#666', 3, 3, 6);}
var backgroundColor = '#eee';this.context.fillStyle = backgroundColor;this.context.arc(this.centerx, this.centery, this.radius, 0.0001, 6.28, false);this.context.fill();RGraph.NoShadow(this);this.context.strokeStyle = '#666';this.context.arc(this.centerx, this.centery, this.radius, 0, 6.28, false);this.context.fillStyle = backgroundColor;this.context.arc(this.centerx, this.centery, this.radius, 0, 6.28, false);this.context.fill();this.context.beginPath();this.context.strokeStyle = '#bbb';for (var i=0; i<=360; i+=3){
this.context.arc(this.centerx, this.centery, this.radius, 0, RGraph.degrees2Radians(i), false);this.context.lineTo(this.centerx, this.centery);}
this.context.stroke();this.context.beginPath();this.context.strokeStyle = '#333';for (var i=0; i<=360; i+=9){
this.context.arc(this.centerx, this.centery, this.radius, 0, RGraph.degrees2Radians(i), false);this.context.lineTo(this.centerx, this.centery);}
this.context.stroke();this.context.beginPath();this.context.fillStyle = backgroundColor;this.context.strokeStyle = backgroundColor;this.context.arc(this.centerx, this.centery, this.radius - 5, 0, 6.28, false);this.context.fill();this.context.stroke();this.context.beginPath();this.context.strokeStyle = '#ddd';for (var i=0; i<360; i+=18){
this.context.arc(this.centerx, this.centery, this.radius, 0, RGraph.degrees2Radians(i), false);this.context.lineTo(this.centerx, this.centery);}
this.context.stroke();this.context.beginPath();this.context.strokeStyle = 'black';this.context.arc(this.centerx, this.centery, this.radius, 0, 6.2830, false);this.context.stroke();if(this.Get('chart.shadow.inner')){
this.context.beginPath();this.context.shadowColor = 'black';this.context.shadowBlur = 6;this.context.shadowOffsetX = 3;this.context.shadowOffsetY = 3;this.context.arc(this.centerx, this.centery, this.radius - this.Get('chart.label.area'), 0, 6.28, 0);this.context.fill();this.context.stroke();RGraph.NoShadow(this);}
var greengrad = this.canvas.getContext('2d').createRadialGradient(this.canvas.width / 2, this.canvas.height / 2, 0, this.canvas.width / 2, this.canvas.height / 2, this.canvas.width / 2, this.canvas.width / 2);greengrad.addColorStop(0, 'white');greengrad.addColorStop(1, this.Get('chart.green.color'));if(this.Get('chart.tickmarks.highlighted')){
this.context.beginPath();this.context.lineWidth = 5;this.context.strokeStyle = greengrad;this.context.arc(this.centerx, this.centery, this.radius - 2.5,
-1.57,
((this.Get('chart.green.max') / this.end) * 6.2830) - 1.57,
0);this.context.stroke();this.context.lineWidth = 1;}
this.context.beginPath();this.context.fillStyle = greengrad;this.context.arc(
this.centerx,
this.centery,
this.radius - this.Get('chart.label.area'),
-1.57,
( (this.Get('chart.green.max') / this.end) * 6.2830) - 1.57,
false
);this.context.lineTo(this.centerx, this.centery);this.context.closePath();this.context.fill();var yellowgrad = this.canvas.getContext('2d').createRadialGradient(this.canvas.width / 2, this.canvas.height / 2, 0, this.canvas.width / 2, this.canvas.height / 2, this.canvas.width / 2, this.canvas.width / 2);yellowgrad.addColorStop(0, 'white');yellowgrad.addColorStop(1, this.Get('chart.yellow.color'));if(this.Get('chart.tickmarks.highlighted')){
this.context.beginPath();this.context.lineWidth = 5;this.context.strokeStyle = yellowgrad;this.context.arc(this.centerx, this.centery, this.radius - 2.5, (
(this.Get('chart.green.max') / this.end) * 6.2830) - 1.57,
((this.Get('chart.red.min') / this.end) * 6.2830) - 1.57,
0);this.context.stroke();this.context.lineWidth = 1;}
this.context.beginPath();this.context.fillStyle = yellowgrad;this.context.arc(
this.centerx,
this.centery,
this.radius - this.Get('chart.label.area'),
( (this.Get('chart.green.max') / this.end) * 6.2830) - 1.57,
( (this.Get('chart.red.min') / this.end) * 6.2830) - 1.57,
false
);this.context.lineTo(this.centerx, this.centery);this.context.closePath();this.context.fill();var redgrad = this.canvas.getContext('2d').createRadialGradient(this.canvas.width / 2, this.canvas.height / 2, 0, this.canvas.width / 2, this.canvas.height / 2, this.canvas.width / 2, this.canvas.width / 2);redgrad.addColorStop(0, 'white');redgrad.addColorStop(1, this.Get('chart.red.color'));if(this.Get('chart.tickmarks.highlighted')){
this.context.beginPath();this.context.lineWidth = 5;this.context.strokeStyle = redgrad;this.context.arc(this.centerx, this.centery, this.radius - 2.5, ( (this.Get('chart.red.min') / this.end) * 6.2830) - 1.57,(2 * Math.PI) - (0.5 * Math.PI),0);this.context.stroke();this.context.lineWidth = 1;}
this.context.beginPath();this.context.fillStyle = redgrad;this.context.strokeStyle = redgrad;this.context.arc(
this.centerx,
this.centery,
this.radius - this.Get('chart.label.area'),
( (this.Get('chart.red.min') / this.end) * 6.2830) - 1.57,
6.2830 - (0.25 * 6.2830),
false
);this.context.lineTo(this.centerx, this.centery);this.context.closePath();this.context.fill();if(this.Get('chart.border')){
var grad = this.context.createRadialGradient(this.centerx, this.centery, this.radius, this.centerx, this.centery, this.radius + 15);grad.addColorStop(1, '#bbb');grad.addColorStop(0.5, '#eee');grad.addColorStop(0, '#bbb');this.context.beginPath();this.context.fillStyle = grad;this.context.strokeStyle = grad;this.context.lineWidth = 17;this.context.arc(this.centerx, this.centery, this.radius + 7.5, 0, 2 * Math.PI, 0);this.context.stroke();}
this.context.lineWidth = this.Get('chart.linewidth');if(this.Get('chart.title')){
RGraph.DrawTitle(this.canvas, this.Get('chart.title'), this.Get('chart.gutter'), null, this.Get('chart.text.size') + 2);}
}
RGraph.Odometer.prototype.DrawNeedle = function ()
{
this.context.fillStyle = '#666';this.context.strokeStyle = '#666';this.context.beginPath();this.context.moveTo(this.centerx, this.centery);this.context.arc(this.centerx, this.centery, 10, 0, 6.28, false);this.context.fill();this.context.closePath();this.context.stroke();this.context.fill();if(this.Get('chart.needle.type') == 'pointer'){
this.context.strokeStyle = this.Get('chart.needle.color');this.context.lineWidth = this.Get('chart.needle.thickness');this.context.lineCap = 'round';this.context.lineJoin = 'round';this.context.beginPath();this.context.beginPath();this.context.moveTo(this.centerx, this.centery);if(this.Get('chart.needle.tail')){
this.context.arc(this.centerx,
this.centery,
20,
(((this.value / this.range) * 360) + 90) / 57.3,
(((this.value / this.range) * 360) + 90 + 1) / 57.3,
false
);}
this.context.arc(this.centerx,
this.centery,
this.radius - 15 - this.Get('chart.gutter'),
(((this.value / this.range) * 360) - 90) / 57.3,
(((this.value / this.range) * 360) - 90 + (document.all ? 0.1 : 0) ) / 57.3,
false
);this.context.closePath();} else if(this.Get('chart.needle.type') == 'triangle'){
this.context.lineEnd = 'square';this.context.lineJoin = 'miter';this.context.beginPath();this.context.strokeStyle = 'black';this.context.fillStyle = 'black';this.context.arc(this.centerx, this.centery, 5, (((this.value / this.range) * 360)) / 57.3, (((this.value / this.range) * 360)) / 57.3, 0);this.context.arc(this.centerx, this.centery, 5, (((this.value / this.range) * 360) + 180) / 57.3, (((this.value / this.range) * 360) + 180) / 57.3, 0);this.context.arc(this.centerx, this.centery, this.radius - this.Get('chart.label.area') - 10, (((this.value / this.range) * 360) - 90) / 57.3, ((((this.value / this.range) * 360) - 90) / 57.3) + 0.01, 0);this.context.closePath();this.context.stroke();this.context.fill();this.context.beginPath();this.context.arc(this.centerx, this.centery, 7, 0, 6.28, 0);this.context.closePath();this.context.fill();}
this.context.stroke();this.context.fill();this.context.beginPath();this.context.fillStyle = 'black';this.context.arc(this.centerx, this.centery, 7, 0.01, 6.2830, false);this.context.fill();if(this.Get('chart.needle.head') && this.Get('chart.needle.type') == 'pointer'){
this.context.fillStyle = this.Get('chart.needle.color');this.context.lineJoin = 'miter';this.context.lineCap = 'square';this.context.beginPath();this.context.arc(this.centerx,
this.centery,
this.radius - 15 - this.Get('chart.gutter') - 1,
(((this.value / this.range) * 360) - 90) / 57.3,
(((this.value / this.range) * 360) - 90 + 1) / 57.3,
false
);this.context.arc(this.centerx, this.centery, this.radius - this.Get('chart.label.area') - 15, RGraph.degrees2Radians( ((this.value / this.range) * 360) - 87), RGraph.degrees2Radians( ((this.value / this.range) * 360) - 93), 1);this.context.closePath();this.context.fill();this.context.stroke();}
}
RGraph.Odometer.prototype.DrawLabels = function ()
{
var context = this.context;var size = this.Get('chart.text.size');var font = this.Get('chart.text.font');var centerx = this.centerx;var centery = this.centery;var r = this.radius - (this.Get('chart.label.area') / 2);var end = this.end;var decimals = this.Get('chart.scale.decimals');var labels = this.Get('chart.labels');context.beginPath();context.fillStyle = this.Get('chart.text.color');if(labels){
for (var i=0; i<labels.length; ++i){
RGraph.Text(context,
font,
size,
centerx + (Math.cos(((i / labels.length) * 6.28) - 1.57) * (this.radius - (this.Get('chart.label.area') / 2) ) ),
centery + (Math.sin(((i / labels.length) * 6.28) - 1.57) * (this.radius - (this.Get('chart.label.area') / 2) ) ),
String(labels[i]),
'center',
'center');}
} else {
RGraph.Text(context, font, size, centerx + (0.588 * r ), centery - (0.809 * r ), String((end * (1/10)).toFixed(decimals)), 'center', 'center', false, 36);RGraph.Text(context, font, size, centerx + (0.951 * r ), centery - (0.309 * r), String((end * (2/10)).toFixed(decimals)), 'center', 'center', false, 72);RGraph.Text(context, font, size, centerx + (0.949 * r), centery + (0.287 * r), String((end * (3/10)).toFixed(decimals)), 'center', 'center', false, 108);RGraph.Text(context, font, size, centerx + (0.588 * r ), centery + (0.809 * r ), String((end * (4/10)).toFixed(decimals)), 'center', 'center', false, 144);RGraph.Text(context, font, size, centerx, centery + r, String((end * (5/10)).toFixed(decimals)), 'center', 'center', false, 180);RGraph.Text(context, font, size, centerx - (0.588 * r ), centery + (0.809 * r ), String((end * (6/10)).toFixed(decimals)), 'center', 'center', false, 216);RGraph.Text(context, font, size, centerx - (0.949 * r), centery + (0.300 * r), a = String((end * (7/10)).toFixed(decimals)), 'center', 'center', false, 252);RGraph.Text(context, font, size, centerx - (0.951 * r), centery - (0.309 * r), String((end * (8/10)).toFixed(decimals)), 'center', 'center', false, 288);RGraph.Text(context, font, size, centerx - (0.588 * r ), centery - (0.809 * r ), String((end * (9/10)).toFixed(decimals)), 'center', 'center', false, 324);RGraph.Text(context, font, size, centerx, centery - r, this.Get('chart.zerostart') ? '0' : String((end * (10/10)).toFixed(decimals)), 'center', 'center', false, 360);}
this.context.fill();if(this.Get('chart.value.text')){
context.strokeStyle = 'black';RGraph.Text(context, font, size + 2, centerx, centery + size + 2 + 10, String(this.Get('chart.units.pre') + this.value + this.Get('chart.units.post')), 'center', 'center', true,  null, 'white');}
}
