// THIS FILE HAS BEEN MINIFIED

if(typeof(RGraph) == 'undefined') RGraph = {};RGraph.Rose = function (id, data)
{
this.id = id;this.canvas = document.getElementById(id);this.context = this.canvas.getContext('2d');this.data = data;this.canvas.__object__ = this;this.type = 'rose';this.isRGraph = true;RGraph.OldBrowserCompat(this.context);this.centerx = 0;this.centery = 0;this.radius = 0;this.max = 0;this.properties = {
'chart.colors':                 ['rgb(255,0,0)', 'rgb(0,255,255)', 'rgb(0,255,0)', 'rgb(127,127,127)', 'rgb(0,0,255)', 'rgb(255,128,255)'],
'chart.colors.alpha':           null,
'chart.strokestyle':            'black',
'chart.gutter':                 25,
'chart.title':                  '',
'chart.title.hpos':             null,
'chart.title.vpos':             null,
'chart.labels':                 null,
'chart.labels.position':       'center',
'chart.labels.axes':            'nsew',
'chart.text.color':             'black',
'chart.text.font':              'Verdana',
'chart.text.size':              10,
'chart.key':                    null,
'chart.key.shadow':             false,
'chart.key.shadow.color':       '#666',
'chart.key.shadow.blur':        3,
'chart.key.shadow.offsetx':     2,
'chart.key.shadow.offsety':     2,
'chart.key.background':         'white',
'chart.key.position':           'graph',
'chart.contextmenu':            null,
'chart.tooltips':               null,
'chart.tooltips.effect':         'fade',
'chart.tooltips.css.class':      'RGraph_tooltip',
'chart.annotatable':            false,
'chart.annotate.color':         'black',
'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.adjustable':             false,
'chart.ymax':                   null
}
if(typeof(RGraph) == 'undefined'){
alert('[ROSE] Fatal error: The common library does not appear to have been included');}
}
RGraph.Rose.prototype.Set = function (name, value)
{
this.properties[name.toLowerCase()] = value;}
RGraph.Rose.prototype.Get = function (name)
{
return this.properties[name.toLowerCase()];}
RGraph.Rose.prototype.Draw = function ()
{
RGraph.FireCustomEvent(this, 'onbeforedraw');this.radius = (Math.min(this.canvas.width, this.canvas.height) / 2);this.centerx = this.canvas.width / 2;this.centery = this.canvas.height / 2;this.angles = [];this.total = 0;this.startRadians = 0;if(this.Get('chart.key') && this.Get('chart.key').length > 0 && this.Get('chart.key').length >= 3){
this.centerx = this.centerx - this.Get('chart.gutter') + 5;}
this.DrawBackground();this.DrawRose();this.DrawLabels();if(this.Get('chart.contextmenu')){
RGraph.ShowContext(this);}
if(this.Get('chart.tooltips')){
RGraph.Register(this);this.canvas.onclick = function (e)
{
var obj = e.target.__object__;var canvas = e.target;var context = canvas.getContext('2d');e = RGraph.FixEventObject(e);RGraph.Redraw();var segment = RGraph.getSegment(e);if(segment && obj.Get('chart.tooltips')[segment[5]]){
context.beginPath();context.strokeStyle = 'black';context.fillStyle = 'rgba(255,255,255,0.5)';context.arc(segment[0], segment[1], segment[2], segment[3] / 57.3, segment[4] / 57.3, false);context.lineTo(obj.centerx, obj.centery);context.closePath();context.fill();context.stroke();context.strokeStyle = 'rgba(0,0,0,0)';obj.DrawLabels();RGraph.Tooltip(canvas, obj.Get('chart.tooltips')[segment[5]], e.pageX, e.pageY, segment[5]);e.stopPropagation();return;}
}
this.canvas.onmousemove = function (e)
{
var obj = e.target.__object__;var canvas = e.target;var context = canvas.getContext('2d');e = RGraph.FixEventObject(e);var segment = RGraph.getSegment(e);if(segment && obj.Get('chart.tooltips')[segment[5]]){
canvas.style.cursor = 'pointer';return;}
canvas.style.cursor = 'default';}
}
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);}
if(this.Get('chart.adjustable')){
RGraph.AllowAdjusting(this);}
RGraph.FireCustomEvent(this, 'ondraw');}
RGraph.Rose.prototype.DrawBackground = function ()
{
this.context.lineWidth = 1;this.context.strokeStyle = '#ccc';for (var i=15; i<this.radius - this.Get('chart.gutter') - (document.all ? 5 : 0); i+=15){
this.context.arc(this.centerx, this.centery, i, 0, (2 * Math.PI), 0);}
this.context.stroke();this.context.beginPath();for (var i=15; i<360; i+=15){
this.context.arc(this.centerx, this.centery, this.radius - this.Get('chart.gutter'), i / 57.3, (i + 0.1) / 57.3, 0);this.context.lineTo(this.centerx, this.centery);}
this.context.stroke();this.context.beginPath();this.context.strokeStyle = 'black';this.context.moveTo(this.centerx - this.radius + this.Get('chart.gutter'), this.centery);this.context.lineTo(this.centerx + this.radius - this.Get('chart.gutter'), this.centery);this.context.moveTo(this.centerx - this.radius + this.Get('chart.gutter'), this.centery - 5);this.context.lineTo(this.centerx - this.radius + this.Get('chart.gutter'), this.centery + 5);this.context.moveTo(this.centerx + this.radius - this.Get('chart.gutter'), this.centery - 5);this.context.lineTo(this.centerx + this.radius - this.Get('chart.gutter'), this.centery + 5);for (var i=(this.centerx - this.radius + this.Get('chart.gutter')); i<(this.centerx + this.radius - this.Get('chart.gutter')); i+=20){
this.context.moveTo(i,  this.centery - 3);this.context.lineTo(i,  this.centery + 3);}
for (var i=(this.centery - this.radius + this.Get('chart.gutter')); i<(this.centery + this.radius - this.Get('chart.gutter')); i+=20){
this.context.moveTo(this.centerx - 3, i);this.context.lineTo(this.centerx + 3, i);}
this.context.moveTo(this.centerx, this.centery - this.radius + this.Get('chart.gutter'));this.context.lineTo(this.centerx, this.centery + this.radius - this.Get('chart.gutter'));this.context.moveTo(this.centerx - 5, this.centery - this.radius + this.Get('chart.gutter'));this.context.lineTo(this.centerx + 5, this.centery - this.radius + this.Get('chart.gutter'));this.context.moveTo(this.centerx - 5, this.centery + this.radius - this.Get('chart.gutter'));this.context.lineTo(this.centerx + 5, this.centery + this.radius - this.Get('chart.gutter'));this.context.closePath();this.context.stroke();}
RGraph.Rose.prototype.DrawRose = function ()
{
var data = this.data;if(data.length < 2){
alert('[ROSE] Must be at least two data points! [' + data + ']');return;}
if(!this.Get('chart.ymax')){
this.scale = RGraph.getScale(RGraph.array_max(data));this.max = this.scale[4];} else {
var ymax = this.Get('chart.ymax');this.scale = [
ymax * 0.2,
ymax * 0.4,
ymax * 0.6,
ymax * 0.8,
ymax * 1
];this.max = this.scale[4];}
this.sum = RGraph.array_sum(data);this.context.moveTo(this.centerx, this.centery);this.context.stroke();if(this.Get('chart.colors.alpha')){
this.context.globalAlpha = this.Get('chart.colors.alpha');}
for (var i=0; i<this.data.length; ++i){
this.context.strokeStyle = this.Get('chart.strokestyle');if(this.Get('chart.colors')[i]){
this.context.fillStyle = this.Get('chart.colors')[i];}
var segmentRadians = (1 / this.data.length) * (2 * Math.PI);this.context.beginPath();var radius = (this.data[i] / this.max) * (this.radius - this.Get('chart.gutter') - 10);this.context.arc(this.centerx, this.centery, radius, this.startRadians - (Math.PI / 2), this.startRadians + segmentRadians - (Math.PI / 2), 0);this.context.lineTo(this.centerx, this.centery);this.context.fill();this.context.closePath();this.angles.push([
((this.startRadians - (Math.PI / 2)) * 57.3) + 90,
(((this.startRadians + segmentRadians) - (Math.PI / 2)) * 57.3) + 90,
radius
]);this.startRadians += segmentRadians;this.context.stroke();}
if(this.Get('chart.colors.alpha')){
this.context.globalAlpha = 1;}
if(this.Get('chart.title')){
RGraph.DrawTitle(this.canvas, this.Get('chart.title'), this.Get('chart.gutter'), this.centerx, this.Get('chart.text.size') + 2);}
}
RGraph.Rose.prototype.DrawLabels = function ()
{
this.context.lineWidth = 1;var key = this.Get('chart.key');if(key && key.length){
RGraph.DrawKey(this, key, this.Get('chart.colors'));}
this.context.fillStyle = 'black';this.context.strokeStyle = 'black';var r = this.radius - 10;var font_face = this.Get('chart.text.font');var font_size = this.Get('chart.text.size');var context = this.context;var axes = this.Get('chart.labels.axes').toLowerCase();if(typeof(this.Get('chart.labels')) == 'object' && this.Get('chart.labels')){
this.DrawCircularLabels(context, this.Get('chart.labels'), font_face, font_size, r + 10);}
var color = 'rgba(255,255,255,0.8)';if(axes.indexOf('n') > -1){
RGraph.Text(context, font_face, font_size, this.centerx, this.centery - ((r - this.Get('chart.gutter')) * 0.2), String(this.scale[0]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery - ((r - this.Get('chart.gutter')) * 0.4), String(this.scale[1]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery - ((r - this.Get('chart.gutter')) * 0.6), String(this.scale[2]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery - ((r - this.Get('chart.gutter')) * 0.8), String(this.scale[3]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery - r + this.Get('chart.gutter'), String(this.scale[4]), 'center', 'center', true, false, color);}
if(axes.indexOf('s') > -1){
RGraph.Text(context, font_face, font_size, this.centerx, this.centery + ((r - this.Get('chart.gutter')) * 0.2), String(this.scale[0]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery + ((r - this.Get('chart.gutter')) * 0.4), String(this.scale[1]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery + ((r - this.Get('chart.gutter')) * 0.6), String(this.scale[2]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery + ((r - this.Get('chart.gutter')) * 0.8), String(this.scale[3]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx, this.centery + r - this.Get('chart.gutter'), String(this.scale[4]), 'center', 'center', true, false, color);}
if(axes.indexOf('e') > -1){
RGraph.Text(context, font_face, font_size, this.centerx + ((r - this.Get('chart.gutter')) * 0.2), this.centery, String(this.scale[0]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx + ((r - this.Get('chart.gutter')) * 0.4), this.centery, String(this.scale[1]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx + ((r - this.Get('chart.gutter')) * 0.6), this.centery, String(this.scale[2]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx + ((r - this.Get('chart.gutter')) * 0.8), this.centery, String(this.scale[3]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx + r - this.Get('chart.gutter'), this.centery, String(this.scale[4]), 'center', 'center', true, false, color);}
if(axes.indexOf('w') > -1){
RGraph.Text(context, font_face, font_size, this.centerx - ((r - this.Get('chart.gutter')) * 0.2), this.centery, String(this.scale[0]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx - ((r - this.Get('chart.gutter')) * 0.4), this.centery, String(this.scale[1]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx - ((r - this.Get('chart.gutter')) * 0.6), this.centery, String(this.scale[2]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx - ((r - this.Get('chart.gutter')) * 0.8), this.centery, String(this.scale[3]), 'center', 'center', true, false, color);RGraph.Text(context, font_face, font_size, this.centerx - r + this.Get('chart.gutter'), this.centery, String(this.scale[4]), 'center', 'center', true, false, color);}
RGraph.Text(context, font_face, font_size, this.centerx,  this.centery, '0', 'center', 'center', true, false, color);}
RGraph.Rose.prototype.DrawCircularLabels = function (context, labels, font_face, font_size, r)
{
var position = this.Get('chart.labels.position');var r = r - this.Get('chart.gutter') + 10;for (var i=0; i<labels.length; ++i){
var a = (360 / labels.length) * (i + 1) - (360 / (labels.length * 2));var a = a - 90 + (this.Get('chart.labels.position') == 'edge' ? ((360 / labels.length) / 2) : 0);var x = Math.cos(a / 57.29577866666) * (r + 10);var y = Math.sin(a / 57.29577866666) * (r + 10);RGraph.Text(context, font_face, font_size, this.centerx + x, this.centery + y, String(labels[i]), 'center', 'center');}
}