rgraph-rails 4.64 → 4.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -8
  3. data/lib/rgraph-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/RGraph.bar.js +1 -1
  5. data/vendor/assets/javascripts/RGraph.bipolar.js +11 -11
  6. data/vendor/assets/javascripts/RGraph.common.dynamic.js +8 -6
  7. data/vendor/assets/javascripts/RGraph.common.sheets.js +6 -4
  8. data/vendor/assets/javascripts/RGraph.drawing.background.js +1 -1
  9. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +1 -1
  10. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +1 -1
  11. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +1 -1
  12. data/vendor/assets/javascripts/RGraph.drawing.poly.js +4 -6
  13. data/vendor/assets/javascripts/RGraph.drawing.text.js +1 -1
  14. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +1 -1
  15. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +1 -1
  16. data/vendor/assets/javascripts/RGraph.fuel.js +1 -1
  17. data/vendor/assets/javascripts/RGraph.funnel.js +1 -1
  18. data/vendor/assets/javascripts/RGraph.gantt.js +1 -1
  19. data/vendor/assets/javascripts/RGraph.gauge.js +8 -8
  20. data/vendor/assets/javascripts/RGraph.hbar.js +1 -1
  21. data/vendor/assets/javascripts/RGraph.hprogress.js +1 -1
  22. data/vendor/assets/javascripts/RGraph.line.js +1 -1
  23. data/vendor/assets/javascripts/RGraph.meter.js +4 -6
  24. data/vendor/assets/javascripts/RGraph.odo.js +1 -1
  25. data/vendor/assets/javascripts/RGraph.pie.js +1 -1
  26. data/vendor/assets/javascripts/RGraph.radar.js +1 -1
  27. data/vendor/assets/javascripts/RGraph.rose.js +1 -1
  28. data/vendor/assets/javascripts/RGraph.rscatter.js +1 -1
  29. data/vendor/assets/javascripts/RGraph.scatter.js +1 -1
  30. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1 -1
  31. data/vendor/assets/javascripts/RGraph.svg.bar.js +25 -16
  32. data/vendor/assets/javascripts/RGraph.svg.bipolar.js +104 -0
  33. data/vendor/assets/javascripts/RGraph.svg.common.core.js +73 -32
  34. data/vendor/assets/javascripts/RGraph.svg.common.key.js +4 -3
  35. data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +6 -4
  36. data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +2 -1
  37. data/vendor/assets/javascripts/RGraph.svg.funnel.js +7 -7
  38. data/vendor/assets/javascripts/RGraph.svg.gauge.js +33 -0
  39. data/vendor/assets/javascripts/RGraph.svg.hbar.js +15 -12
  40. data/vendor/assets/javascripts/RGraph.svg.line.js +43 -29
  41. data/vendor/assets/javascripts/RGraph.svg.pie.js +15 -13
  42. data/vendor/assets/javascripts/RGraph.svg.radar.js +7 -7
  43. data/vendor/assets/javascripts/RGraph.svg.rose.js +13 -13
  44. data/vendor/assets/javascripts/RGraph.svg.scatter.js +14 -8
  45. data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +7 -7
  46. data/vendor/assets/javascripts/RGraph.svg.waterfall.js +13 -10
  47. data/vendor/assets/javascripts/RGraph.thermometer.js +1 -1
  48. data/vendor/assets/javascripts/RGraph.vprogress.js +1 -1
  49. data/vendor/assets/javascripts/RGraph.waterfall.js +3 -3
  50. metadata +4 -2
@@ -2,7 +2,7 @@
2
2
  RGraph=window.RGraph||{isRGraph:true};RGraph.Pie=function(conf)
3
3
  {if(typeof conf==='object'&&typeof conf.data==='object'&&typeof conf.id==='string'){var id=conf.id,canvas=document.getElementById(id),data=conf.data,parseConfObjectForOptions=true;}else{var id=conf,canvas=document.getElementById(id),data=arguments[1];}
4
4
  this.id=id;this.canvas=canvas;this.context=this.canvas.getContext?this.canvas.getContext("2d",{alpha:(typeof id==='object'&&id.alpha===false)?false:true}):null;this.canvas.__object__=this;this.total=0;this.subTotal=0;this.angles=[];this.data=data;this.properties=[];this.type='pie';this.isRGraph=true;this.coords=[];this.coords.key=[];this.coordsSticks=[];this.coordsText=[];this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.original_colors=[];this.firstDraw=true;this.exploding=null;for(var i=0;i<this.data.length;++i){if(typeof this.data[i]==='string'){this.data[i]=parseFloat(this.data[i]);}}
5
- this.properties={'chart.centerx.adjust':0,'chart.centery.adjust':0,'chart.colors':['red','#ccc','#cfc','blue','pink','yellow','black','orange','cyan','purple','#78CAEA','#E284E9','white','blue','#9E7BF6'],'chart.strokestyle':'white','chart.linewidth':3,'chart.labels':[],'chart.labels.bold':false,'chart.labels.sticks':false,'chart.labels.sticks.length':7,'chart.labels.sticks.colors':null,'chart.labels.sticks.usecolors':false,'chart.labels.sticks.linewidth':1,'chart.labels.sticks.hlength':5,'chart.labels.sticks.list':false,'chart.labels.ingraph':null,'chart.labels.ingraph.color':null,'chart.labels.ingraph.font':null,'chart.labels.ingraph.size':null,'chart.labels.ingraph.bounding':true,'chart.labels.ingraph.bounding.fill':'white','chart.labels.ingraph.specific':null,'chart.labels.ingraph.units.pre':'','chart.labels.ingraph.units.post':'','chart.labels.ingraph.radius':null,'chart.labels.center':null,'chart.labels.center.size':26,'chart.labels.center.font':'Segoe UI, Arial, Verdana, sans-serif','chart.labels.center.color':'black','chart.labels.center.italic':false,'chart.labels.center.bold':false,'chart.labels.center.units.pre':'','chart.labels.center.units.post':'','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':0.5,'chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.shadow':true,'chart.shadow.color':'#aaa','chart.shadow.offsetx':0,'chart.shadow.offsety':0,'chart.shadow.blur':15,'chart.text.size':12,'chart.text.color':'black','chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':true,'chart.contextmenu':null,'chart.tooltips':null,'chart.tooltips.event':'onclick','chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.highlight.style':'2d','chart.highlight.style.twod.fill':'rgba(255,255,255,0.7)','chart.highlight.style.twod.stroke':'rgba(255,255,255,0.7)','chart.highlight.style.outline.width':null,'chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.border':false,'chart.border.color':'rgba(255,255,255,0.5)','chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.stroke':'black','chart.key.interactive.highlight.chart.fill':'rgba(255,255,255,0.7)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.variant':'pie','chart.variant.donut.width':null,'chart.variant.threed.depth':20,'chart.exploded':[],'chart.effect.roundrobin.multiplier':1,'chart.events.click':null,'chart.events.mousemove':null,'chart.centerpin':null,'chart.centerpin.fill':'gray','chart.centerpin.stroke':'white','chart.origin':0-(Math.PI/2),'chart.events':true,'chart.labels.colors':[],'chart.clearto':'rgba(0,0,0,0)'}
5
+ this.properties={'chart.centerx.adjust':0,'chart.centery.adjust':0,'chart.colors':['red','#ccc','#cfc','blue','pink','yellow','black','orange','cyan','purple','#78CAEA','#E284E9','white','blue','#9E7BF6'],'chart.strokestyle':'white','chart.linewidth':3,'chart.labels':[],'chart.labels.bold':false,'chart.labels.sticks':false,'chart.labels.sticks.length':7,'chart.labels.sticks.colors':null,'chart.labels.sticks.usecolors':false,'chart.labels.sticks.linewidth':1,'chart.labels.sticks.hlength':5,'chart.labels.sticks.list':false,'chart.labels.ingraph':null,'chart.labels.ingraph.color':null,'chart.labels.ingraph.font':null,'chart.labels.ingraph.size':null,'chart.labels.ingraph.bounding':true,'chart.labels.ingraph.bounding.fill':'white','chart.labels.ingraph.specific':null,'chart.labels.ingraph.units.pre':'','chart.labels.ingraph.units.post':'','chart.labels.ingraph.radius':null,'chart.labels.center':null,'chart.labels.center.size':26,'chart.labels.center.font':'Arial, Verdana, sans-serif','chart.labels.center.color':'black','chart.labels.center.italic':false,'chart.labels.center.bold':false,'chart.labels.center.units.pre':'','chart.labels.center.units.post':'','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':0.5,'chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.shadow':true,'chart.shadow.color':'#aaa','chart.shadow.offsetx':0,'chart.shadow.offsety':0,'chart.shadow.blur':15,'chart.text.size':12,'chart.text.color':'black','chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':false,'chart.contextmenu':null,'chart.tooltips':null,'chart.tooltips.event':'onclick','chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.highlight.style':'2d','chart.highlight.style.twod.fill':'rgba(255,255,255,0.7)','chart.highlight.style.twod.stroke':'rgba(255,255,255,0.7)','chart.highlight.style.outline.width':null,'chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.border':false,'chart.border.color':'rgba(255,255,255,0.5)','chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.stroke':'black','chart.key.interactive.highlight.chart.fill':'rgba(255,255,255,0.7)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.variant':'pie','chart.variant.donut.width':null,'chart.variant.threed.depth':20,'chart.exploded':[],'chart.effect.roundrobin.multiplier':1,'chart.events.click':null,'chart.events.mousemove':null,'chart.centerpin':null,'chart.centerpin.fill':'gray','chart.centerpin.stroke':'white','chart.origin':0-(Math.PI/2),'chart.events':true,'chart.labels.colors':[],'chart.clearto':'rgba(0,0,0,0)'}
6
6
  for(var i=0,len=data.length;i<len;i++){this.total+=data[i];this['$'+i]={};}
7
7
  if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
8
8
  var RG=RGraph,ca=this.canvas,co=ca.getContext('2d'),prop=this.properties,pa2=RG.path2,win=window,doc=document,ma=Math
@@ -3,7 +3,7 @@ RGraph=window.RGraph||{isRGraph:true};RGraph.Radar=function(conf)
3
3
  {if(typeof conf==='object'&&typeof conf.data==='object'&&typeof conf.id==='string'){var parseConfObjectForOptions=true;if(typeof conf.data[0]==='number'||typeof conf.data[0]==='string'){conf.data=[conf.data];}}else{var conf={id:conf,data:[]};if(typeof arguments[1]==='object'&&typeof arguments[1][0]==='number'){for(var i=1;i<arguments.length;++i){conf.data.push(RGraph.arrayClone(arguments[i]));}}else if(typeof arguments[1]==='object'&&typeof arguments[1][0]==='object'&&typeof arguments[1][0][0]==='number'){conf.data=RGraph.arrayClone(arguments[1]);}}
4
4
  this.id=conf.id;this.canvas=document.getElementById(conf.id);this.context=this.canvas.getContext?this.canvas.getContext("2d"):null;this.canvas.__object__=this;this.type='radar';this.isRGraph=true;this.data=[];this.max=0;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coords=[];this.coordsText=[];this.original_data=[];this.original_colors=[];this.firstDraw=true;for(var i=0,len=conf.data.length;i<len;++i){for(var j=0;j<conf.data[i].length;++j){if(typeof conf.data[i][j]==='string'){conf.data[i][j]=parseFloat(conf.data[i][j]);}}
5
5
  this.original_data.push(RGraph.arrayClone(conf.data[i]));this.data.push(RGraph.arrayClone(conf.data[i]));this.max=Math.max(this.max,RGraph.arrayMax(conf.data[i]));}
6
- this.properties={'chart.strokestyle':'#aaa','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.linewidth':1,'chart.colors':['rgba(255,255,0,0.25)','rgba(0,255,255,0.25)','rgba(255,0,0,0.5)','red','green','blue','pink','aqua','brown','orange','grey'],'chart.colors.alpha':null,'chart.circle':0,'chart.circle.fill':'red','chart.circle.stroke':'black','chart.labels':[],'chart.labels.color':null,'chart.labels.offset':10,'chart.labels.axes':'','chart.labels.background.fill':'white','chart.labels.boxed':false,'chart.labels.axes.bold':[],'chart.labels.axes.boxed':null,'chart.labels.axes.boxed.zero':true,'chart.labels.axes.boxed.background':'rgba(255,255,255,0.9)','chart.labels.specific':[],'chart.labels.count':5,'chart.background.circles':true,'chart.background.circles.count':null,'chart.background.circles.color':'#ddd','chart.background.circles.poly':true,'chart.background.circles.spokes':24,'chart.text.size':12,'chart.text.size.scale':null,'chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.color':'black','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':true,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.color':'black','chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.linewidth':1,'chart.key':null,'chart.key.background':'white','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.position':'graph','chart.key.halign':'right','chart.key.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.stroke':'rgba(255,0,0,0.3)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','chart.contextmenu':null,'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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.tooltips.effect':'fade','chart.tooltips.event':'onmousemove','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.highlight.stroke':'gray','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.highlight.point.radius':2,'chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.ymax':null,'chart.accumulative':false,'chart.radius':null,'chart.events.click':null,'chart.events.mousemove':null,'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.units.pre':'','chart.units.post':'','chart.tooltips':null,'chart.tooltips.event':'onmousemove','chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.numxticks':5,'chart.numyticks':5,'chart.axes.color':'rgba(0,0,0,0)','chart.highlights':false,'chart.highlights.stroke':'#ddd','chart.highlights.fill':null,'chart.highlights.radius':3,'chart.fill.click':null,'chart.fill.mousemove':null,'chart.fill.tooltips':null,'chart.fill.highlight.fill':'rgba(255,255,255,0.7)','chart.fill.highlight.stroke':'rgba(0,0,0,0)','chart.fill.mousemove.redraw':false,'chart.animation.trace.clip':1,'chart.clearto':'rgba(0,0,0,0)'}
6
+ this.properties={'chart.strokestyle':'#aaa','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.linewidth':1,'chart.colors':['rgba(255,255,0,0.25)','rgba(0,255,255,0.25)','rgba(255,0,0,0.5)','red','green','blue','pink','aqua','brown','orange','grey'],'chart.colors.alpha':null,'chart.circle':0,'chart.circle.fill':'red','chart.circle.stroke':'black','chart.labels':[],'chart.labels.color':null,'chart.labels.offset':10,'chart.labels.axes':'','chart.labels.background.fill':'white','chart.labels.boxed':false,'chart.labels.axes.bold':[],'chart.labels.axes.boxed':null,'chart.labels.axes.boxed.zero':true,'chart.labels.axes.boxed.background':'rgba(255,255,255,0.9)','chart.labels.specific':[],'chart.labels.count':5,'chart.background.circles':true,'chart.background.circles.count':null,'chart.background.circles.color':'#ddd','chart.background.circles.poly':true,'chart.background.circles.spokes':24,'chart.text.size':12,'chart.text.size.scale':null,'chart.text.font':'Arial, Verdana, sans-serif','chart.text.color':'black','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':false,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.color':'black','chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.linewidth':1,'chart.key':null,'chart.key.background':'white','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.position':'graph','chart.key.halign':'right','chart.key.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.stroke':'rgba(255,0,0,0.3)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','chart.contextmenu':null,'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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.tooltips.effect':'fade','chart.tooltips.event':'onmousemove','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.highlight.stroke':'gray','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.highlight.point.radius':2,'chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.ymax':null,'chart.accumulative':false,'chart.radius':null,'chart.events.click':null,'chart.events.mousemove':null,'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.units.pre':'','chart.units.post':'','chart.tooltips':null,'chart.tooltips.event':'onmousemove','chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.numxticks':5,'chart.numyticks':5,'chart.axes.color':'rgba(0,0,0,0)','chart.highlights':false,'chart.highlights.stroke':'#ddd','chart.highlights.fill':null,'chart.highlights.radius':3,'chart.fill.click':null,'chart.fill.mousemove':null,'chart.fill.tooltips':null,'chart.fill.highlight.fill':'rgba(255,255,255,0.7)','chart.fill.highlight.stroke':'rgba(0,0,0,0)','chart.fill.mousemove.redraw':false,'chart.animation.trace.clip':1,'chart.clearto':'rgba(0,0,0,0)'}
7
7
  for(var dataset=0;dataset<this.data.length;++dataset){if(this.data[dataset].length<3){alert('[RADAR] You must specify at least 3 data points');return;}}
8
8
  var idx=0;for(var dataset=0;dataset<this.data.length;++dataset){for(var i=0,len=this.data[dataset].length;i<len;++i){this['$'+(idx++)]={};}}
9
9
  if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
@@ -1,7 +1,7 @@
1
1
 
2
2
  RGraph=window.RGraph||{isRGraph:true};RGraph.Effects=RGraph.Effects||{};RGraph.Effects.Rose=RGraph.Effects.Rose||{};RGraph.Rose=function(conf)
3
3
  {if(typeof conf==='object'&&typeof conf.data==='object'&&typeof conf.id==='string'){var parseConfObjectForOptions=true;}else{var conf={id:conf};conf.data=arguments[1];}
4
- this.id=conf.id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext?this.canvas.getContext("2d"):null;this.data=conf.data;this.canvas.__object__=this;this.type='rose';this.isRGraph=true;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.centerx=0;this.centery=0;this.radius=0;this.max=0;this.angles=[];this.angles2=[];this.properties={'chart.background.axes':true,'chart.background.axes.color':'black','chart.background.grid':true,'chart.background.grid.color':'#ccc','chart.background.grid.size':null,'chart.background.grid.radials':null,'chart.background.grid.count':5,'chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.angles.start':0,'chart.colors':['rgba(255,0,0,0.5)','rgba(255,255,0,0.5)','rgba(0,255,255,0.5)','rgb(0,255,0)','gray','blue','rgb(255,128,255)','green','pink','gray','aqua'],'chart.linewidth':1,'chart.colors.sequential':false,'chart.colors.alpha':null,'chart.margin':0,'chart.strokestyle':'#aaa','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.shadow':false,'chart.shadow.color':'#aaa','chart.shadow.offsetx':0,'chart.shadow.offsety':0,'chart.shadow.blur':15,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.labels':null,'chart.labels.color':null,'chart.labels.position':'center','chart.labels.axes':'nsew','chart.labels.boxed':false,'chart.labels.offset':0,'chart.text.color':'black','chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.size':12,'chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':true,'chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.stroke':'black','chart.key.interactive.highlight.chart.fill':'rgba(255,255,255,0.7)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','chart.contextmenu':null,'chart.tooltips':null,'chart.tooltips.event':'onclick','chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.adjustable':false,'chart.ymax':null,'chart.ymin':0,'chart.scale.decimals':null,'chart.scale.point':'.','chart.scale.thousand':',','chart.variant':'stacked','chart.variant.threed.depth':10,'chart.exploded':0,'chart.events.mousemove':null,'chart.events.click':null,'chart.animation.roundrobin.factor':1,'chart.animation.roundrobin.radius':true,'chart.animation.grow.multiplier':1,'chart.labels.count':5,'chart.segment.highlight':false,'chart.segment.highlight.count':null,'chart.segment.highlight.fill':'rgba(0,255,0,0.5)','chart.segment.highlight.stroke':'rgba(0,0,0,0)','chart.clearto':'rgba(0,0,0,0)'}
4
+ this.id=conf.id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext?this.canvas.getContext("2d"):null;this.data=conf.data;this.canvas.__object__=this;this.type='rose';this.isRGraph=true;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.centerx=0;this.centery=0;this.radius=0;this.max=0;this.angles=[];this.angles2=[];this.properties={'chart.background.axes':true,'chart.background.axes.color':'black','chart.background.grid':true,'chart.background.grid.color':'#ccc','chart.background.grid.size':null,'chart.background.grid.radials':null,'chart.background.grid.count':5,'chart.centerx':null,'chart.centery':null,'chart.radius':null,'chart.angles.start':0,'chart.colors':['rgba(255,0,0,0.5)','rgba(255,255,0,0.5)','rgba(0,255,255,0.5)','rgb(0,255,0)','gray','blue','rgb(255,128,255)','green','pink','gray','aqua'],'chart.linewidth':1,'chart.colors.sequential':false,'chart.colors.alpha':null,'chart.margin':0,'chart.strokestyle':'#aaa','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.shadow':false,'chart.shadow.color':'#aaa','chart.shadow.offsetx':0,'chart.shadow.offsety':0,'chart.shadow.blur':15,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.labels':null,'chart.labels.color':null,'chart.labels.position':'center','chart.labels.axes':'nsew','chart.labels.boxed':false,'chart.labels.offset':0,'chart.text.color':'black','chart.text.font':'Arial, Verdana, sans-serif','chart.text.size':12,'chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':false,'chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.stroke':'black','chart.key.interactive.highlight.chart.fill':'rgba(255,255,255,0.7)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','chart.contextmenu':null,'chart.tooltips':null,'chart.tooltips.event':'onclick','chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.adjustable':false,'chart.ymax':null,'chart.ymin':0,'chart.scale.decimals':null,'chart.scale.point':'.','chart.scale.thousand':',','chart.variant':'stacked','chart.variant.threed.depth':10,'chart.exploded':0,'chart.events.mousemove':null,'chart.events.click':null,'chart.animation.roundrobin.factor':1,'chart.animation.roundrobin.radius':true,'chart.animation.grow.multiplier':1,'chart.labels.count':5,'chart.segment.highlight':false,'chart.segment.highlight.count':null,'chart.segment.highlight.fill':'rgba(0,255,0,0.5)','chart.segment.highlight.stroke':'rgba(0,0,0,0)','chart.clearto':'rgba(0,0,0,0)'}
5
5
  for(var i=0;i<this.data.length;++i){if(typeof this.data[i]==='string'){this.data[i]=parseFloat(this.data[i]);}else if(typeof this.data[i]==='object'){for(var j=0;j<this.data[i].length;++j){if(typeof this.data[i][j]==='string'){this.data[i][j]=parseFloat(this.data[i][j]);}}}}
6
6
  var linear_data=RGraph.arrayLinearize(this.data);for(var i=0;i<linear_data.length;++i){this["$"+i]={};}
7
7
  if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
@@ -5,7 +5,7 @@ this.id=conf.id
5
5
  this.canvas=document.getElementById(this.id)
6
6
  this.context=this.canvas.getContext?this.canvas.getContext("2d"):null;this.canvas.__object__=this;this.type='rscatter';this.hasTooltips=false;this.isRGraph=true;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.centerx=0;this.centery=0;this.radius=0;this.max=0;for(var i=0;i<this.data.length;++i){for(var j=0;j<this.data[i].length;++j){if(typeof this.data[i][j][0]==='string'){this.data[i][j][0]=parseFloat(this.data[i][j][0]);}
7
7
  if(typeof this.data[i][j][1]==='string'){this.data[i][j][1]=parseFloat(this.data[i][j][1]);}}}
8
- this.properties={'chart.background.color':'transparent','chart.background.grid':true,'chart.background.grid.diagonals':true,'chart.background.grid.diagonals.count':null,'chart.background.grid.radials':true,'chart.background.grid.radials.count':null,'chart.background.grid.linewidth':1,'chart.background.grid.color':'#ccc','chart.radius':null,'chart.colors':[],'chart.colors.default':'black','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.labels':null,'chart.labels.color':null,'chart.labels.axes':'nsew','chart.labels.axes.background':'rgba(255,255,255,0.8)','chart.labels.count':5,'chart.text.color':'black','chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.size':12,'chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':true,'chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.fill':'rgba(255,0,0,0.9)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','chart.contextmenu':null,'chart.tooltips':null,'chart.tooltips.event':'onmousemove','chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.tooltips.hotspot':3,'chart.tooltips.coords.page':false,'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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.background':null,'chart.ymax':null,'chart.ymin':0,'chart.tickmarks':'cross','chart.ticksize':3,'chart.scale.decimals':null,'chart.scale.point':'.','chart.scale.thousand':',','chart.scale.round':false,'chart.scale.zerostart':true,'chart.units.pre':'','chart.units.post':'','chart.events.mousemove':null,'chart.events.click':null,'chart.highlight.stroke':'transparent','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.highlight.point.radius':3,'chart.axes.color':'black','chart.axes.numticks':null,'chart.axes.caps':true,'chart.segment.highlight':false,'chart.segment.highlight.count':null,'chart.segment.highlight.fill':'rgba(0,255,0,0.5)','chart.segment.highlight.stroke':'rgba(0,0,0,0)','chart.line':false,'chart.line.close':false,'chart.line.linewidth':1,'chart.line.colors':['black'],'chart.line.shadow':false,'chart.line.shadow.color':'black','chart.line.shadow.blur':2,'chart.line.shadow.offsetx':3,'chart.line.shadow.offsety':3,'chart.clearto':'rgba(0,0,0,0)'}
8
+ this.properties={'chart.background.color':'transparent','chart.background.grid':true,'chart.background.grid.diagonals':true,'chart.background.grid.diagonals.count':null,'chart.background.grid.radials':true,'chart.background.grid.radials.count':null,'chart.background.grid.linewidth':1,'chart.background.grid.color':'#ccc','chart.radius':null,'chart.colors':[],'chart.colors.default':'black','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':25,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.bold':true,'chart.title.font':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.labels':null,'chart.labels.color':null,'chart.labels.axes':'nsew','chart.labels.axes.background':'rgba(255,255,255,0.8)','chart.labels.count':5,'chart.text.color':'black','chart.text.font':'Arial, Verdana, sans-serif','chart.text.size':12,'chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':false,'chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.fill':'rgba(255,0,0,0.9)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.text.color':'black','chart.contextmenu':null,'chart.tooltips':null,'chart.tooltips.event':'onmousemove','chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.tooltips.hotspot':3,'chart.tooltips.coords.page':false,'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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.background':null,'chart.ymax':null,'chart.ymin':0,'chart.tickmarks':'cross','chart.ticksize':3,'chart.scale.decimals':null,'chart.scale.point':'.','chart.scale.thousand':',','chart.scale.round':false,'chart.scale.zerostart':true,'chart.units.pre':'','chart.units.post':'','chart.events.mousemove':null,'chart.events.click':null,'chart.highlight.stroke':'transparent','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.highlight.point.radius':3,'chart.axes.color':'black','chart.axes.numticks':null,'chart.axes.caps':true,'chart.segment.highlight':false,'chart.segment.highlight.count':null,'chart.segment.highlight.fill':'rgba(0,255,0,0.5)','chart.segment.highlight.stroke':'rgba(0,0,0,0)','chart.line':false,'chart.line.close':false,'chart.line.linewidth':1,'chart.line.colors':['black'],'chart.line.shadow':false,'chart.line.shadow.color':'black','chart.line.shadow.blur':2,'chart.line.shadow.offsetx':3,'chart.line.shadow.offsety':3,'chart.clearto':'rgba(0,0,0,0)'}
9
9
  for(var i=0,idx=0;i<this.data.length;++i){for(var j=0,len=this.data[i].length;j<len;j+=1,idx+=1){this['$'+idx]={}}}
10
10
  if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
11
11
  var RG=RGraph,ca=this.canvas,co=ca.getContext('2d'),prop=this.properties,pa2=RG.path2,win=window,doc=document,ma=Math
@@ -4,7 +4,7 @@ RGraph=window.RGraph||{isRGraph:true};RGraph.Scatter=function(conf)
4
4
  if(!RGraph.isArray(this.data[0][0])){this.data=[this.data];}
5
5
  for(var i=0,len=this.data.length;i<len;++i){for(var j=0,len2=this.data[i].length;j<len2;++j){if(typeof this.data[i][j]==='object'&&!RGraph.isNull(this.data[i][j])&&typeof this.data[i][j][0]==='string'){if(this.data[i][j][0].match(/^[.0-9]+$/)){this.data[i][j][0]=parseFloat(this.data[i][j][0]);}else if(this.data[i][j][0]===''){this.data[i][j][0]=0;}}
6
6
  if(typeof this.data[i][j]==='object'&&!RGraph.isNull(this.data[i][j])&&typeof this.data[i][j][1]==='string'){if(this.data[i][j][1].match(/[.0-9]+/)){this.data[i][j][1]=parseFloat(this.data[i][j][1]);}else if(this.data[i][j][1]===''){this.data[i][j][1]=0;}}}}
7
- this.id=conf.id;this.canvas=document.getElementById(this.id);this.canvas.__object__=this;this.context=this.canvas.getContext?this.canvas.getContext('2d'):null;this.max=0;this.coords=[];this.type='scatter';this.isRGraph=true;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.properties={'chart.background.barcolor1':'rgba(0,0,0,0)','chart.background.barcolor2':'rgba(0,0,0,0)','chart.background.grid':true,'chart.background.grid.width':1,'chart.background.grid.color':'#ddd','chart.background.grid.hsize':20,'chart.background.grid.vsize':20,'chart.background.hbars':null,'chart.background.vbars':null,'chart.background.grid.vlines':true,'chart.background.grid.hlines':true,'chart.background.grid.border':true,'chart.background.grid.autofit':true,'chart.background.grid.autofit.align':true,'chart.background.grid.autofit.numhlines':5,'chart.background.grid.autofit.numvlines':20,'chart.background.image':null,'chart.background.image.stretch':true,'chart.background.image.x':null,'chart.background.image.y':null,'chart.background.image.w':null,'chart.background.image.h':null,'chart.background.image.align':null,'chart.background.color':null,'chart.text.size':12,'chart.text.angle':0,'chart.text.color':'black','chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':true,'chart.tooltips':[],'chart.tooltips.effect':'fade','chart.tooltips.event':'onmousemove','chart.tooltips.hotspot':3,'chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.tooltips.coords.page':false,'chart.units.pre':'','chart.units.post':'','chart.numyticks':10,'chart.tickmarks':'cross','chart.tickmarks.image.halign':'center','chart.tickmarks.image.valign':'center','chart.tickmarks.image.offsetx':0,'chart.tickmarks.image.offsety':0,'chart.ticksize':5,'chart.numxticks':true,'chart.xaxis':true,'chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':30,'chart.colors.bubble.graduated':true,'chart.xmin':0,'chart.xmax':0,'chart.ymax':null,'chart.ymin':0,'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.scale.zerostart':true,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.bold':true,'chart.title.font':null,'chart.title.xaxis':'','chart.title.xaxis.bold':true,'chart.title.xaxis.size':null,'chart.title.xaxis.font':null,'chart.title.xaxis.color':null,'chart.title.yaxis':'','chart.title.yaxis.bold':true,'chart.title.yaxis.size':null,'chart.title.yaxis.font':null,'chart.title.yaxis.color':null,'chart.title.xaxis.pos':null,'chart.title.yaxis.pos':null,'chart.title.yaxis.x':null,'chart.title.yaxis.y':null,'chart.title.xaxis.x':null,'chart.title.xaxis.y':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.labels':[],'chart.labels.bold':false,'chart.labels.color':null,'chart.labels.ingraph':null,'chart.labels.above':false,'chart.labels.above.size':8,'chart.labels.above.decimals':0,'chart.labels.offsetx':0,'chart.labels.offsety':0,'chart.ylabels.offsetx':0,'chart.ylabels.offsety':0,'chart.ylabels':true,'chart.ylabels.count':5,'chart.ylabels.invert':false,'chart.ylabels.specific':null,'chart.ylabels.inside':false,'chart.contextmenu':null,'chart.defaultcolor':'black','chart.xaxispos':'bottom','chart.yaxispos':'left','chart.crosshairs':false,'chart.crosshairs.color':'#333','chart.crosshairs.linewidth':1,'chart.crosshairs.coords':false,'chart.crosshairs.coords.fixed':true,'chart.crosshairs.coords.fadeout':false,'chart.crosshairs.coords.labels.x':'X','chart.crosshairs.coords.labels.y':'Y','chart.crosshairs.coords.formatter.x':null,'chart.crosshairs.coords.formatter.y':null,'chart.crosshairs.hline':true,'chart.crosshairs.vline':true,'chart.annotatable':false,'chart.annotate.color':'black','chart.line':false,'chart.line.linewidth':1,'chart.line.colors':['green','red'],'chart.line.shadow.color':'rgba(0,0,0,0)','chart.line.shadow.blur':2,'chart.line.shadow.offsetx':3,'chart.line.shadow.offsety':3,'chart.line.stepped':false,'chart.line.visible':true,'chart.noaxes':false,'chart.noyaxis':false,'chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.fill':'rgba(255,0,0,0.9)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.text.color':'black','chart.axis.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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.boxplot.width':1,'chart.boxplot.capped':true,'chart.resizable':false,'chart.resize.handle.background':null,'chart.xmin':0,'chart.labels.specific.align':'left','chart.xscale':false,'chart.xscale.units.pre':'','chart.xscale.units.post':'','chart.xscale.numlabels':10,'chart.xscale.formatter':null,'chart.xscale.decimals':0,'chart.xscale.thousand':',','chart.xscale.point':'.','chart.noendxtick':false,'chart.noendytick':true,'chart.events.mousemove':null,'chart.events.click':null,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.clearto':'rgba(0,0,0,0)','chart.animation.trace':false,'chart.animation.trace.clip':1}
7
+ this.id=conf.id;this.canvas=document.getElementById(this.id);this.canvas.__object__=this;this.context=this.canvas.getContext?this.canvas.getContext('2d'):null;this.max=0;this.coords=[];this.type='scatter';this.isRGraph=true;this.uid=RGraph.CreateUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.properties={'chart.background.barcolor1':'rgba(0,0,0,0)','chart.background.barcolor2':'rgba(0,0,0,0)','chart.background.grid':true,'chart.background.grid.width':1,'chart.background.grid.color':'#ddd','chart.background.grid.hsize':20,'chart.background.grid.vsize':20,'chart.background.hbars':null,'chart.background.vbars':null,'chart.background.grid.vlines':true,'chart.background.grid.hlines':true,'chart.background.grid.border':true,'chart.background.grid.autofit':true,'chart.background.grid.autofit.align':true,'chart.background.grid.autofit.numhlines':5,'chart.background.grid.autofit.numvlines':20,'chart.background.image':null,'chart.background.image.stretch':true,'chart.background.image.x':null,'chart.background.image.y':null,'chart.background.image.w':null,'chart.background.image.h':null,'chart.background.image.align':null,'chart.background.color':null,'chart.text.size':12,'chart.text.angle':0,'chart.text.color':'black','chart.text.font':'Arial, Verdana, sans-serif','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':false,'chart.tooltips':[],'chart.tooltips.effect':'fade','chart.tooltips.event':'onmousemove','chart.tooltips.hotspot':3,'chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.tooltips.coords.page':false,'chart.units.pre':'','chart.units.post':'','chart.numyticks':10,'chart.tickmarks':'cross','chart.tickmarks.image.halign':'center','chart.tickmarks.image.valign':'center','chart.tickmarks.image.offsetx':0,'chart.tickmarks.image.offsety':0,'chart.ticksize':5,'chart.numxticks':true,'chart.xaxis':true,'chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':30,'chart.colors.bubble.graduated':true,'chart.xmin':0,'chart.xmax':0,'chart.ymax':null,'chart.ymin':0,'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.scale.zerostart':true,'chart.title':'','chart.title.background':null,'chart.title.hpos':null,'chart.title.vpos':null,'chart.title.bold':true,'chart.title.font':null,'chart.title.xaxis':'','chart.title.xaxis.bold':true,'chart.title.xaxis.size':null,'chart.title.xaxis.font':null,'chart.title.xaxis.color':null,'chart.title.yaxis':'','chart.title.yaxis.bold':true,'chart.title.yaxis.size':null,'chart.title.yaxis.font':null,'chart.title.yaxis.color':null,'chart.title.xaxis.pos':null,'chart.title.yaxis.pos':null,'chart.title.yaxis.x':null,'chart.title.yaxis.y':null,'chart.title.xaxis.x':null,'chart.title.xaxis.y':null,'chart.title.x':null,'chart.title.y':null,'chart.title.halign':null,'chart.title.valign':null,'chart.labels':[],'chart.labels.bold':false,'chart.labels.color':null,'chart.labels.ingraph':null,'chart.labels.above':false,'chart.labels.above.size':8,'chart.labels.above.decimals':0,'chart.labels.offsetx':0,'chart.labels.offsety':0,'chart.ylabels.offsetx':0,'chart.ylabels.offsety':0,'chart.ylabels':true,'chart.ylabels.count':5,'chart.ylabels.invert':false,'chart.ylabels.specific':null,'chart.ylabels.inside':false,'chart.contextmenu':null,'chart.defaultcolor':'black','chart.xaxispos':'bottom','chart.yaxispos':'left','chart.crosshairs':false,'chart.crosshairs.color':'#333','chart.crosshairs.linewidth':1,'chart.crosshairs.coords':false,'chart.crosshairs.coords.fixed':true,'chart.crosshairs.coords.fadeout':false,'chart.crosshairs.coords.labels.x':'X','chart.crosshairs.coords.labels.y':'Y','chart.crosshairs.coords.formatter.x':null,'chart.crosshairs.coords.formatter.y':null,'chart.crosshairs.hline':true,'chart.crosshairs.vline':true,'chart.annotatable':false,'chart.annotate.color':'black','chart.line':false,'chart.line.linewidth':1,'chart.line.colors':['green','red'],'chart.line.shadow.color':'rgba(0,0,0,0)','chart.line.shadow.blur':2,'chart.line.shadow.offsetx':3,'chart.line.shadow.offsety':3,'chart.line.stepped':false,'chart.line.visible':true,'chart.noaxes':false,'chart.noyaxis':false,'chart.key':null,'chart.key.background':'white','chart.key.position':'graph','chart.key.halign':'right','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.position.gutter.boxed':false,'chart.key.position.x':null,'chart.key.position.y':null,'chart.key.interactive':false,'chart.key.interactive.highlight.chart.fill':'rgba(255,0,0,0.9)','chart.key.interactive.highlight.label':'rgba(255,0,0,0.2)','chart.key.color.shape':'square','chart.key.rounded':true,'chart.key.linewidth':1,'chart.key.colors':null,'chart.key.text.color':'black','chart.axis.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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.boxplot.width':1,'chart.boxplot.capped':true,'chart.resizable':false,'chart.resize.handle.background':null,'chart.xmin':0,'chart.labels.specific.align':'left','chart.xscale':false,'chart.xscale.units.pre':'','chart.xscale.units.post':'','chart.xscale.numlabels':10,'chart.xscale.formatter':null,'chart.xscale.decimals':0,'chart.xscale.thousand':',','chart.xscale.point':'.','chart.noendxtick':false,'chart.noendytick':true,'chart.events.mousemove':null,'chart.events.click':null,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','chart.clearto':'rgba(0,0,0,0)','chart.animation.trace':false,'chart.animation.trace.clip':1}
8
8
  for(var i=0;i<this.data.length;++i){for(var j=0;j<this.data[i].length;++j){if(RGraph.isNull(this.data[i][j])){this.data[i][j]=[];}
9
9
  if(this.data[i][j]&&typeof(this.data[i][j][0])=='string'){this.data[i][j][0]=RGraph.parseDate(this.data[i][j][0]);}}}
10
10
  this.data_arr=[];for(var i=0;i<this.data.length;++i){for(var j=0;j<this.data[i].length;++j){this.data_arr.push(this.data[i][j]);}}
@@ -1,7 +1,7 @@
1
1
 
2
2
  RGraph=window.RGraph||{isRGraph:true};RGraph.SemiCircularProgress=function(conf)
3
3
  {if(typeof conf==='object'&&typeof conf.id==='string'){var parseConfObjectForOptions=true;}else{var conf={id:arguments[0],min:arguments[1],max:arguments[2],value:arguments[3]}}
4
- this.id=conf.id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext('2d');this.canvas.__object__=this;this.min=RGraph.stringsToNumbers(conf.min);this.max=RGraph.stringsToNumbers(conf.max);this.value=RGraph.stringsToNumbers(conf.value);this.type='semicircularprogress';this.coords=[];this.isRGraph=true;this.currentValue=null;this.uid=RGraph.createUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.properties={'chart.background.color':'rgba(0,0,0,0)','chart.colors':['#0c0'],'chart.linewidth':2,'chart.strokestyle':'#666','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':35,'chart.radius':null,'chart.centerx':null,'chart.centery':null,'chart.width':null,'chart.angles.start':Math.PI,'chart.angles.end':(2*Math.PI),'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.scale.formatter':null,'chart.scale.round':false,'chart.shadow':false,'chart.shadow.color':'rgba(220,220,220,1)','chart.shadow.blur':2,'chart.shadow.offsetx':2,'chart.shadow.offsety':2,'chart.labels.center':true,'chart.labels.center.font':null,'chart.labels.center.bold':false,'chart.labels.center.italic':false,'chart.labels.center.fade':false,'chart.labels.center.size':40,'chart.labels.center.color':'black','chart.labels.center.valign':'bottom','chart.labels.min.color':null,'chart.labels.min.font':null,'chart.labels.min.bold':false,'chart.labels.min.size':null,'chart.labels.min.italic':false,'chart.labels.min.offset.angle':0,'chart.labels.min.offsetx':0,'chart.labels.min.offsety':0,'chart.labels.max.color':null,'chart.labels.max.font':null,'chart.labels.max.bold':false,'chart.labels.max.size':null,'chart.labels.max.italic':false,'chart.labels.max.offset.angle':0,'chart.labels.max.offsetx':0,'chart.labels.max.offsety':0,'chart.title':'','chart.title.bold':true,'chart.title.italic':false,'chart.title.font':null,'chart.title.size':null,'chart.title.color':'black','chart.text.size':12,'chart.text.color':'black','chart.text.font':'Segoe UI, Arial, Verdana, sans-serif','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':true,'chart.contextmenu':null,'chart.units.pre':'','chart.units.post':'','chart.tooltips':null,'chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.tooltips.event':'onclick','chart.tooltips.coords.page':true,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.adjustable':false,'chart.events.click':null,'chart.events.mousemove':null,'chart.clearto':'rgba(0,0,0,0)'}
4
+ this.id=conf.id;this.canvas=document.getElementById(this.id);this.context=this.canvas.getContext('2d');this.canvas.__object__=this;this.min=RGraph.stringsToNumbers(conf.min);this.max=RGraph.stringsToNumbers(conf.max);this.value=RGraph.stringsToNumbers(conf.value);this.type='semicircularprogress';this.coords=[];this.isRGraph=true;this.currentValue=null;this.uid=RGraph.createUID();this.canvas.uid=this.canvas.uid?this.canvas.uid:RGraph.CreateUID();this.colorsParsed=false;this.coordsText=[];this.original_colors=[];this.firstDraw=true;this.properties={'chart.background.color':'rgba(0,0,0,0)','chart.colors':['#0c0'],'chart.linewidth':2,'chart.strokestyle':'#666','chart.gutter.left':25,'chart.gutter.right':25,'chart.gutter.top':25,'chart.gutter.bottom':35,'chart.radius':null,'chart.centerx':null,'chart.centery':null,'chart.width':null,'chart.angles.start':Math.PI,'chart.angles.end':(2*Math.PI),'chart.scale.decimals':0,'chart.scale.point':'.','chart.scale.thousand':',','chart.scale.formatter':null,'chart.scale.round':false,'chart.shadow':false,'chart.shadow.color':'rgba(220,220,220,1)','chart.shadow.blur':2,'chart.shadow.offsetx':2,'chart.shadow.offsety':2,'chart.labels.center':true,'chart.labels.center.font':null,'chart.labels.center.bold':false,'chart.labels.center.italic':false,'chart.labels.center.fade':false,'chart.labels.center.size':40,'chart.labels.center.color':'black','chart.labels.center.valign':'bottom','chart.labels.min.color':null,'chart.labels.min.font':null,'chart.labels.min.bold':false,'chart.labels.min.size':null,'chart.labels.min.italic':false,'chart.labels.min.offset.angle':0,'chart.labels.min.offsetx':0,'chart.labels.min.offsety':0,'chart.labels.max.color':null,'chart.labels.max.font':null,'chart.labels.max.bold':false,'chart.labels.max.size':null,'chart.labels.max.italic':false,'chart.labels.max.offset.angle':0,'chart.labels.max.offsetx':0,'chart.labels.max.offsety':0,'chart.title':'','chart.title.bold':true,'chart.title.italic':false,'chart.title.font':null,'chart.title.size':null,'chart.title.color':'black','chart.text.size':12,'chart.text.color':'black','chart.text.font':'Arial, Verdana, sans-serif','chart.text.accessible':true,'chart.text.accessible.overflow':'visible','chart.text.accessible.pointerevents':false,'chart.contextmenu':null,'chart.units.pre':'','chart.units.post':'','chart.tooltips':null,'chart.tooltips.effect':'fade','chart.tooltips.css.class':'RGraph_tooltip','chart.tooltips.highlight':true,'chart.tooltips.event':'onclick','chart.tooltips.coords.page':true,'chart.highlight.stroke':'rgba(0,0,0,0)','chart.highlight.fill':'rgba(255,255,255,0.7)','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':25,'chart.zoom.delay':16.666,'chart.zoom.shadow':true,'chart.zoom.background':true,'chart.zoom.action':'zoom','chart.resizable':false,'chart.resize.handle.adjust':[0,0],'chart.resize.handle.background':null,'chart.adjustable':false,'chart.events.click':null,'chart.events.mousemove':null,'chart.clearto':'rgba(0,0,0,0)'}
5
5
  if(!this.canvas){alert('[SEMICIRCULARPROGRESS] No canvas support');return;}
6
6
  if(!this.canvas.__rgraph_aa_translated__){this.context.translate(0.5,0.5);this.canvas.__rgraph_aa_translated__=true;}
7
7
  var RG=RGraph,ca=this.canvas,co=ca.getContext('2d'),prop=this.properties,pa2=RG.path2,win=window,doc=document,ma=Math
@@ -3,10 +3,11 @@ RGraph=window.RGraph||{isRGraph:true};RGraph.SVG=RGraph.SVG||{};(function(win,do
3
3
  {var RG=RGraph,ua=navigator.userAgent,ma=Math,win=window,doc=document;RG.SVG.Bar=function(conf)
4
4
  {this.set=function(name,value)
5
5
  {if(arguments.length===1&&typeof name==='object'){for(i in arguments[0]){if(typeof i==='string'){var ret=RG.SVG.commonSetter({object:this,name:i,value:arguments[0][i]});name=ret.name;value=ret.value;this.set(name,value);}}}else{var ret=RG.SVG.commonSetter({object:this,name:name,value:value});name=ret.name;value=ret.value;this.properties[name]=value;if(name==='colors'){this.originalColors=RG.SVG.arrayClone(value);this.colorsParsed=false;}}
6
- return this;};this.id=conf.id;this.uid=RG.SVG.createUID();this.container=document.getElementById(this.id);this.layers={};this.svg=RG.SVG.createSVG({object:this,container:this.container});this.isRGraph=true;this.width=Number(this.svg.getAttribute('width'));this.height=Number(this.svg.getAttribute('height'));this.data=conf.data;this.type='bar';this.coords=[];this.stackedBackfaces=[];this.originalColors={};this.gradientCounter=1;RG.SVG.OR.add(this);this.container.style.display='inline-block';this.properties={gutterLeft:35,gutterRight:35,gutterTop:35,gutterBottom:35,variant:null,variant3dOffsetx:10,variant3dOffsety:5,backgroundColor:null,backgroundImage:null,backgroundImageAspect:'none',backgroundImageStretch:true,backgroundImageOpacity:null,backgroundImageX:null,backgroundImageY:null,backgroundImageW:null,backgroundImageH:null,backgroundGrid:true,backgroundGridColor:'#ddd',backgroundGridLinewidth:1,backgroundGridHlines:true,backgroundGridHlinesCount:null,backgroundGridVlines:true,backgroundGridVlinesCount:null,backgroundGridBorder:true,backgroundGridDashed:false,backgroundGridDotted:false,backgroundGridDashArray:null,colors:['red','#0f0','#00f','#ff0','#0ff','#0f0','pink','orange','gray','black','red','#0f0','#00f','#ff0','#0ff','#0f0','pink','orange','gray','black'],colorsSequential:false,strokestyle:'rgba(0,0,0,0)',hmargin:3,hmarginGrouped:2,yaxis:true,yaxisTickmarks:true,yaxisTickmarksLength:3,yaxisColor:'black',yaxisScale:true,yaxisLabels:null,yaxisLabelsOffsetx:0,yaxisLabelsOffsety:0,yaxisLabelsCount:5,yaxisUnitsPre:'',yaxisUnitsPost:'',yaxisStrict:false,yaxisDecimals:0,yaxisPoint:'.',yaxisThousand:',',yaxisRound:false,yaxisMax:null,yaxisMin:0,yaxisFormatter:null,xaxis:true,xaxisTickmarks:true,xaxisTickmarksLength:5,xaxisLabels:null,xaxisLabelsPosition:'section',xaxisLabelsPositionEdgeTickmarksCount:null,xaxisColor:'black',xaxisLabelsOffsetx:0,xaxisLabelsOffsety:0,labelsAbove:false,labelsAboveFont:null,labelsAboveSize:null,labelsAboveBold:null,labelsAboveItalic:null,labelsAboveColor:null,labelsAboveBackground:null,labelsAboveBackgroundPadding:0,labelsAboveUnitsPre:null,labelsAboveUnitsPost:null,labelsAbovePoint:null,labelsAboveThousand:null,labelsAboveFormatter:null,labelsAboveDecimals:null,labelsAboveOffsetx:0,labelsAboveOffsety:0,labelsAboveHalign:'center',labelsAboveValign:'bottom',labelsAboveSpecific:null,textColor:'black',textFont:'sans-serif',textSize:12,textBold:false,textItalic:false,linewidth:1,grouping:'grouped',tooltips:null,tooltipsOverride:null,tooltipsEffect:'fade',tooltipsCssClass:'RGraph_tooltip',tooltipsEvent:'click',highlightStroke:'rgba(0,0,0,0)',highlightFill:'rgba(255,255,255,0.7)',highlightLinewidth:1,title:'',titleSize:16,titleX:null,titleY:null,titleHalign:'center',titleValign:null,titleColor:'black',titleFont:null,titleBold:false,titleItalic:false,titleSubtitle:'',titleSubtitleSize:10,titleSubtitleX:null,titleSubtitleY:null,titleSubtitleHalign:'center',titleSubtitleValign:null,titleSubtitleColor:'#aaa',titleSubtitleFont:null,titleSubtitleBold:false,titleSubtitleItalic:false,shadow:false,shadowOffsetx:2,shadowOffsety:2,shadowBlur:2,shadowOpacity:0.25,key:null,keyColors:null,keyOffsetx:0,keyOffsety:0,keyTextOffsetx:0,keyTextOffsety:-1,keyTextSize:null,keyTextBold:null,keyTextItalic:null,keyTextFont:null};RG.SVG.getGlobals(this);if(RG.SVG.FX&&typeof RG.SVG.FX.decorate==='function'){RG.SVG.FX.decorate(this);}
6
+ return this;};this.id=conf.id;this.uid=RG.SVG.createUID();this.container=document.getElementById(this.id);this.layers={};this.svg=RG.SVG.createSVG({object:this,container:this.container});this.isRGraph=true;this.data=conf.data;this.type='bar';this.coords=[];this.coords2=[];this.stackedBackfaces=[];this.originalColors={};this.gradientCounter=1;RG.SVG.OR.add(this);this.container.style.display='inline-block';this.properties={gutterLeft:35,gutterRight:35,gutterTop:35,gutterBottom:35,variant:null,variant3dOffsetx:10,variant3dOffsety:5,backgroundColor:null,backgroundImage:null,backgroundImageAspect:'none',backgroundImageStretch:true,backgroundImageOpacity:null,backgroundImageX:null,backgroundImageY:null,backgroundImageW:null,backgroundImageH:null,backgroundGrid:true,backgroundGridColor:'#ddd',backgroundGridLinewidth:1,backgroundGridHlines:true,backgroundGridHlinesCount:null,backgroundGridVlines:true,backgroundGridVlinesCount:null,backgroundGridBorder:true,backgroundGridDashed:false,backgroundGridDotted:false,backgroundGridDashArray:null,colors:['red','#0f0','#00f','#ff0','#0ff','#0f0','pink','orange','gray','black','red','#0f0','#00f','#ff0','#0ff','#0f0','pink','orange','gray','black'],colorsSequential:false,strokestyle:'rgba(0,0,0,0)',errorbars:null,hmargin:3,hmarginGrouped:2,yaxis:true,yaxisTickmarks:true,yaxisTickmarksLength:3,yaxisColor:'black',yaxisScale:true,yaxisLabels:null,yaxisLabelsOffsetx:0,yaxisLabelsOffsety:0,yaxisLabelsCount:5,yaxisUnitsPre:'',yaxisUnitsPost:'',yaxisStrict:false,yaxisDecimals:0,yaxisPoint:'.',yaxisThousand:',',yaxisRound:false,yaxisMax:null,yaxisMin:0,yaxisFormatter:null,xaxis:true,xaxisTickmarks:true,xaxisTickmarksLength:5,xaxisLabels:null,xaxisLabelsPosition:'section',xaxisLabelsPositionSectionTickmarksCount:null,xaxisColor:'black',xaxisLabelsOffsetx:0,xaxisLabelsOffsety:0,labelsAbove:false,labelsAboveFont:null,labelsAboveSize:null,labelsAboveBold:null,labelsAboveItalic:null,labelsAboveColor:null,labelsAboveBackground:null,labelsAboveBackgroundPadding:0,labelsAboveUnitsPre:null,labelsAboveUnitsPost:null,labelsAbovePoint:null,labelsAboveThousand:null,labelsAboveFormatter:null,labelsAboveDecimals:null,labelsAboveOffsetx:0,labelsAboveOffsety:0,labelsAboveHalign:'center',labelsAboveValign:'bottom',labelsAboveSpecific:null,textColor:'black',textFont:'sans-serif',textSize:12,textBold:false,textItalic:false,linewidth:1,grouping:'grouped',tooltips:null,tooltipsOverride:null,tooltipsEffect:'fade',tooltipsCssClass:'RGraph_tooltip',tooltipsEvent:'click',highlightStroke:'rgba(0,0,0,0)',highlightFill:'rgba(255,255,255,0.7)',highlightLinewidth:1,title:'',titleSize:16,titleX:null,titleY:null,titleHalign:'center',titleValign:null,titleColor:'black',titleFont:null,titleBold:false,titleItalic:false,titleSubtitle:null,titleSubtitleSize:10,titleSubtitleX:null,titleSubtitleY:null,titleSubtitleHalign:'center',titleSubtitleValign:null,titleSubtitleColor:'#aaa',titleSubtitleFont:null,titleSubtitleBold:false,titleSubtitleItalic:false,shadow:false,shadowOffsetx:2,shadowOffsety:2,shadowBlur:2,shadowOpacity:0.25,errorbars:null,errorbarsColor:'black',errorbarsLinewidth:1,errorbarsCapwidth:10,key:null,keyColors:null,keyOffsetx:0,keyOffsety:0,keyTextOffsetx:0,keyTextOffsety:-1,keyTextSize:null,keyTextBold:null,keyTextItalic:null,keyTextFont:null};RG.SVG.getGlobals(this);if(RG.SVG.FX&&typeof RG.SVG.FX.decorate==='function'){RG.SVG.FX.decorate(this);}
7
7
  var prop=this.properties;this.draw=function()
8
- {RG.SVG.fireCustomEvent(this,'onbeforedraw');if(prop.variant!=='3d'){prop.variant3dOffsetx=0;prop.variant3dOffsety=0;}else{this.svg.all.setAttribute('transform','skewY(5)');}
9
- RG.SVG.createDefs(this);this.coords=[];this.graphWidth=this.width-prop.gutterLeft-prop.gutterRight;this.graphHeight=this.height-prop.gutterTop-prop.gutterBottom;RG.SVG.resetColorsToOriginalValues({object:this});this.parseColors();var values=[];for(var i=0,max=0;i<this.data.length;++i){if(typeof this.data[i]==='number'){values.push(this.data[i]);}else if(RG.SVG.isArray(this.data[i])&&prop.grouping==='grouped'){values.push(RG.SVG.arrayMax(this.data[i]));}else if(RG.SVG.isArray(this.data[i])&&prop.grouping==='stacked'){values.push(RG.SVG.arraySum(this.data[i]));}}
8
+ {RG.SVG.fireCustomEvent(this,'onbeforedraw');this.width=Number(this.svg.getAttribute('width'));this.height=Number(this.svg.getAttribute('height'));if(prop.variant!=='3d'){prop.variant3dOffsetx=0;prop.variant3dOffsety=0;}else{this.svg.all.setAttribute('transform','skewY(5)');}
9
+ RG.SVG.createDefs(this);this.coords=[];this.coords2=[];this.graphWidth=this.width-prop.gutterLeft-prop.gutterRight;this.graphHeight=this.height-prop.gutterTop-prop.gutterBottom;RG.SVG.resetColorsToOriginalValues({object:this});this.parseColors();var values=[];for(var i=0,max=0;i<this.data.length;++i){if(prop.errorbars&&typeof prop.errorbars[i]==='number'){var errorbar=prop.errorbars[i];}else if(prop.errorbars&&typeof prop.errorbars[i]==='object'&&typeof prop.errorbars[i].max==='number'){var errorbar=prop.errorbars[i].max;}else{var errorbar=0;}
10
+ if(typeof this.data[i]==='number'){values.push(this.data[i]+errorbar);}else if(RG.SVG.isArray(this.data[i])&&prop.grouping==='grouped'){values.push(RG.SVG.arrayMax(this.data[i])+errorbar);}else if(RG.SVG.isArray(this.data[i])&&prop.grouping==='stacked'){values.push(RG.SVG.arraySum(this.data[i])+errorbar);}}
10
11
  var max=RG.SVG.arrayMax(values);if(typeof prop.yaxisMax==='number'){max=prop.yaxisMax;}
11
12
  if(prop.yaxisMin==='mirror'||prop.yaxisMin==='middle'||prop.yaxisMin==='center'){var mirrorScale=true;prop.yaxisMin=0;}
12
13
  this.scale=RG.SVG.getScale({object:this,numlabels:prop.yaxisLabelsCount,unitsPre:prop.yaxisUnitsPre,unitsPost:prop.yaxisUnitsPost,max:max,min:prop.yaxisMin,point:prop.yaxisPoint,round:prop.yaxisRound,thousand:prop.yaxisThousand,decimals:prop.yaxisDecimals,strict:typeof prop.yaxisMax==='number',formatter:prop.yaxisFormatter});if(mirrorScale){this.scale=RG.SVG.getScale({object:this,numlabels:prop.yaxisLabelsCount,unitsPre:prop.yaxisUnitsPre,unitsPost:prop.yaxisUnitsPost,max:this.scale.max,min:this.scale.max* -1,point:prop.yaxisPoint,round:false,thousand:prop.yaxisThousand,decimals:prop.yaxisDecimals,strict:typeof prop.yaxisMax==='number',formatter:prop.yaxisFormatter});}
@@ -15,18 +16,22 @@ this.drawBars();RG.SVG.drawXAxis(this);RG.SVG.drawYAxis(this);this.drawLabelsAbo
15
16
  RG.SVG.attribution(this);RG.SVG.fireCustomEvent(this,'ondraw');return this;};this.drawBars=function()
16
17
  {var y=this.getYCoord(0);if(prop.shadow){RG.SVG.setShadow({object:this,offsetx:prop.shadowOffsetx,offsety:prop.shadowOffsety,blur:prop.shadowBlur,opacity:prop.shadowOpacity,id:'dropShadow'});}
17
18
  for(var i=0,sequentialIndex=0;i<this.data.length;++i,++sequentialIndex){if(typeof this.data[i]==='number'){var outerSegment=this.graphWidth/this.data.length,height=(ma.abs(this.data[i])-ma.abs(this.scale.min))/(ma.abs(this.scale.max)-ma.abs(this.scale.min))*this.graphHeight,width=(this.graphWidth/this.data.length)-prop.hmargin-prop.hmargin,x=prop.gutterLeft+prop.hmargin+(outerSegment*i);if(this.scale.min>=0&&this.scale.max>0){y=this.getYCoord(this.scale.min)-height;}else if(this.scale.min<0&&this.scale.max>0){height=(ma.abs(this.data[i])/(this.scale.max-this.scale.min))*this.graphHeight;y=this.getYCoord(0)-height;if(this.data[i]<0){y=this.getYCoord(0);}}else if(this.scale.min<0&&this.scale.max<0){height=(ma.abs(this.data[i])-ma.abs(this.scale.max))/(ma.abs(this.scale.min)-ma.abs(this.scale.max))*this.graphHeight;y=prop.gutterTop;}
18
- var rect=RG.SVG.create({svg:this.svg,type:'rect',parent:prop.variant==='3d'&&this.data[i]<0?this.threed_xaxis_group:this.svg.all,attr:{stroke:prop.strokestyle,fill:prop.colorsSequential?(prop.colors[sequentialIndex]?prop.colors[sequentialIndex]:prop.colors[prop.colors.length-1]):prop.colors[0],x:x,y:y,width:width<0?0:width,height:height,'stroke-width':prop.linewidth,'data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltip':(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips.length)?prop.tooltips[i]:'','data-index':i,'data-sequential-index':sequentialIndex,'data-value':this.data[i],filter:prop.shadow?'url(#dropShadow)':''}});this.coords.push({object:rect,x:rect.getAttribute('x'),y:rect.getAttribute('y'),width:rect.getAttribute('width'),height:rect.getAttribute('height')});if(prop.variant==='3d'){this.drawTop3dFace({rect:rect,value:this.data[i]});this.drawSide3dFace({rect:rect,value:this.data[i]});}
19
+ var rect=RG.SVG.create({svg:this.svg,type:'rect',parent:prop.variant==='3d'&&this.data[i]<0?this.threed_xaxis_group:this.svg.all,attr:{stroke:prop.strokestyle,fill:prop.colorsSequential?(prop.colors[sequentialIndex]?prop.colors[sequentialIndex]:prop.colors[prop.colors.length-1]):prop.colors[0],x:x,y:y,width:width<0?0:width,height:height,'stroke-width':prop.linewidth,'data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltip':(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips.length)?prop.tooltips[i]:'','data-index':i,'data-sequential-index':sequentialIndex,'data-value':this.data[i],filter:prop.shadow?'url(#dropShadow)':''}});this.drawErrorbar({object:this,element:rect,index:i,value:this.data[i],type:'normal'});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[0]){this.coords2[0]=[];}
20
+ this.coords2[0].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(prop.variant==='3d'){this.drawTop3dFace({rect:rect,value:this.data[i]});this.drawSide3dFace({rect:rect,value:this.data[i]});}
19
21
  if(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips[sequentialIndex]){var obj=this;(function(idx,seq)
20
22
  {rect.addEventListener(prop.tooltipsEvent.replace(/^on/,''),function(e)
21
23
  {obj.removeHighlight();RG.SVG.tooltip({object:obj,index:idx,group:null,sequentialIndex:seq,text:prop.tooltips[seq],event:e});obj.highlight(e.target);},false);rect.addEventListener('mousemove',function(e)
22
24
  {e.target.style.cursor='pointer'},false);})(i,sequentialIndex);}}else if(RG.SVG.isArray(this.data[i])&&prop.grouping==='grouped'){var outerSegment=(this.graphWidth/this.data.length),innerSegment=outerSegment-(2*prop.hmargin);for(var j=0;j<this.data[i].length;++j,++sequentialIndex){var width=((innerSegment-((this.data[i].length-1)*prop.hmarginGrouped))/this.data[i].length),x=(outerSegment*i)+prop.hmargin+prop.gutterLeft+(j*width)+((j-1)*prop.hmarginGrouped);x=prop.gutterLeft+(outerSegment*i)+(width*j)+prop.hmargin+(j*prop.hmarginGrouped);if(this.scale.min===0&&this.scale.max>this.scale.min){var height=((this.data[i][j]-this.scale.min)/(this.scale.max-this.scale.min))*this.graphHeight,y=this.getYCoord(0)-height;}else if(this.scale.max<=0&&this.scale.min<this.scale.max){var height=((this.data[i][j]-this.scale.max)/(this.scale.max-this.scale.min))*this.graphHeight,y=this.getYCoord(this.scale.max);height=ma.abs(height);}else if(this.scale.max>0&&this.scale.min<0){var height=(ma.abs(this.data[i][j])/(this.scale.max-this.scale.min))*this.graphHeight,y=this.data[i][j]<0?this.getYCoord(0):this.getYCoord(this.data[i][j]);}else if(this.scale.min>0&&this.scale.max>this.scale.min){var height=(ma.abs(this.data[i][j]-this.scale.min)/(this.scale.max-this.scale.min))*this.graphHeight,y=this.getYCoord(this.scale.min)-height;}
23
- var rect=RG.SVG.create({svg:this.svg,parent:prop.variant==='3d'&&this.data[i][j]<0?this.threed_xaxis_group:this.svg.all,type:'rect',attr:{stroke:prop['strokestyle'],fill:(prop.colorsSequential&&prop.colors[sequentialIndex])?prop.colors[sequentialIndex]:prop.colors[j],x:x,y:y,width:width,height:height,'stroke-width':prop.linewidth,'data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-index':i,'data-sequential-index':sequentialIndex,'data-tooltip':(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips.length)?prop.tooltips[sequentialIndex]:'','data-value':this.data[i][j],filter:prop.shadow?'url(#dropShadow)':''}});this.coords.push({object:rect,x:rect.getAttribute('x'),y:rect.getAttribute('y'),width:rect.getAttribute('width'),height:rect.getAttribute('height')});if(prop.variant==='3d'){this.drawTop3dFace({rect:rect,value:this.data[i][j]});this.drawSide3dFace({rect:rect,value:this.data[i][j]});}
25
+ var rect=RG.SVG.create({svg:this.svg,parent:prop.variant==='3d'&&this.data[i][j]<0?this.threed_xaxis_group:this.svg.all,type:'rect',attr:{stroke:prop['strokestyle'],fill:(prop.colorsSequential&&prop.colors[sequentialIndex])?prop.colors[sequentialIndex]:prop.colors[j],x:x,y:y,width:width,height:height,'stroke-width':prop.linewidth,'data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-index':i,'data-subindex':j,'data-sequential-index':sequentialIndex,'data-tooltip':(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips.length)?prop.tooltips[sequentialIndex]:'','data-value':this.data[i][j],filter:prop.shadow?'url(#dropShadow)':''}});this.drawErrorbar({object:this,element:rect,index:sequentialIndex,value:this.data[i][j],type:'grouped'});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[i]){this.coords2[i]=[];}
26
+ this.coords2[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(prop.variant==='3d'){this.drawTop3dFace({rect:rect,value:this.data[i][j]});this.drawSide3dFace({rect:rect,value:this.data[i][j]});}
24
27
  if(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips[sequentialIndex]){var obj=this;(function(idx,seq)
25
28
  {obj.removeHighlight();var indexes=RG.SVG.sequentialIndexToGrouped(seq,obj.data);rect.addEventListener(prop.tooltipsEvent.replace(/^on/,''),function(e)
26
29
  {RG.SVG.tooltip({object:obj,group:idx,index:indexes[1],sequentialIndex:seq,text:prop.tooltips[seq],event:e});obj.highlight(e.target);},false);rect.addEventListener('mousemove',function(e)
27
30
  {e.target.style.cursor='pointer'},false);})(i,sequentialIndex);}}
28
31
  --sequentialIndex;}else if(RG.SVG.isArray(this.data[i])&&prop.grouping==='stacked'){var section=(this.graphWidth/this.data.length);var y=this.getYCoord(0);for(var j=0;j<this.data[i].length;++j,++sequentialIndex){var height=(this.data[i][j]/(this.max-this.min))*this.graphHeight,width=section-(2*prop.hmargin),x=prop.gutterLeft+(i*section)+prop.hmargin,y=y-height;if(j===0&&prop.shadow){var fullHeight=(RG.SVG.arraySum(this.data[i])/(this.max-this.min))*this.graphHeight;var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{fill:'white',x:x,y:this.height-prop.gutterBottom-fullHeight,width:width,height:fullHeight,'stroke-width':0,'data-index':i,filter:'url(#dropShadow)'}});this.stackedBackfaces[i]=rect;}
29
- var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{stroke:prop['strokestyle'],fill:prop.colorsSequential?(prop.colors[sequentialIndex]?prop.colors[sequentialIndex]:prop.colors[prop.colors.length-1]):prop.colors[j],x:x,y:y,width:width,height:height,'stroke-width':prop.linewidth,'data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-index':i,'data-sequential-index':sequentialIndex,'data-tooltip':(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips.length)?prop.tooltips[sequentialIndex]:'','data-value':this.data[i][j]}});this.coords.push({object:rect,x:rect.getAttribute('x'),y:rect.getAttribute('y'),width:rect.getAttribute('width'),height:rect.getAttribute('height')});if(prop.variant==='3d'){this.drawTop3dFace({rect:rect,value:this.data[i][j]});this.drawSide3dFace({rect:rect,value:this.data[i][j]});}
32
+ var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{stroke:prop['strokestyle'],fill:prop.colorsSequential?(prop.colors[sequentialIndex]?prop.colors[sequentialIndex]:prop.colors[prop.colors.length-1]):prop.colors[j],x:x,y:y,width:width,height:height,'stroke-width':prop.linewidth,'data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-index':i,'data-subindex':j,'data-sequential-index':sequentialIndex,'data-tooltip':(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips.length)?prop.tooltips[sequentialIndex]:'','data-value':this.data[i][j]}});if(j===(this.data[i].length-1)){this.drawErrorbar({object:this,element:rect,index:i,value:this.data[i][j],type:'stacked'});}
33
+ this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[i]){this.coords2[i]=[];}
34
+ this.coords2[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(prop.variant==='3d'){this.drawTop3dFace({rect:rect,value:this.data[i][j]});this.drawSide3dFace({rect:rect,value:this.data[i][j]});}
30
35
  if(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips[sequentialIndex]){var obj=this;(function(idx,seq)
31
36
  {rect.addEventListener(prop.tooltipsEvent.replace(/^on/,''),function(e)
32
37
  {obj.removeHighlight();var indexes=RG.SVG.sequentialIndexToGrouped(seq,obj.data);RG.SVG.tooltip({object:obj,index:indexes[1],group:idx,sequentialIndex:seq,text:prop.tooltips[seq],event:e});obj.highlight(e.target);},false);rect.addEventListener('mousemove',function(e)
@@ -35,33 +40,37 @@ if(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips[sequentialIndex]){var obj=this;(
35
40
  {if(value>this.scale.max){return null;}
36
41
  var y,xaxispos=prop.xaxispos;if(value<this.scale.min){return null;}
37
42
  y=((value-this.scale.min)/(this.scale.max-this.scale.min));y*=(this.height-prop.gutterTop-prop.gutterBottom);y=this.height-prop.gutterBottom-y;return y;};this.highlight=function(rect)
38
- {var x=rect.getAttribute('x'),y=rect.getAttribute('y'),width=rect.getAttribute('width'),height=rect.getAttribute('height');var highlight=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{stroke:prop.highlightStroke,fill:prop.highlightFill,x:x,y:y,width:width,height:height,'stroke-width':prop.highlightLinewidth}});if(prop.tooltipsEvent==='mousemove'){}
43
+ {var x=rect.getAttribute('x'),y=rect.getAttribute('y'),width=rect.getAttribute('width'),height=rect.getAttribute('height');var highlight=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{stroke:prop.highlightStroke,fill:prop.highlightFill,x:x,y:y,width:width,height:height,'stroke-width':prop.highlightLinewidth},style:{pointerEvents:'none'}});if(prop.tooltipsEvent==='mousemove'){}
39
44
  RG.SVG.REG.set('highlight',highlight);};this.parseColors=function()
40
45
  {if(!Object.keys(this.originalColors).length){this.originalColors={colors:RG.SVG.arrayClone(prop.colors),backgroundGridColor:RG.SVG.arrayClone(prop.backgroundGridColor),highlightFill:RG.SVG.arrayClone(prop.highlightFill),backgroundColor:RG.SVG.arrayClone(prop.backgroundColor)}}
41
46
  var colors=prop.colors;if(colors){for(var i=0;i<colors.length;++i){colors[i]=RG.SVG.parseColorLinear({object:this,color:colors[i]});}}
42
47
  prop.backgroundGridColor=RG.SVG.parseColorLinear({object:this,color:prop.backgroundGridColor});prop.highlightFill=RG.SVG.parseColorLinear({object:this,color:prop.highlightFill});prop.backgroundColor=RG.SVG.parseColorLinear({object:this,color:prop.backgroundColor});};this.drawLabelsAbove=function()
43
48
  {if(prop.labelsAbove){var data_seq=RG.SVG.arrayLinearize(this.data),seq=0,stacked_total=0;;for(var i=0;i<this.coords.length;++i,seq++){var num=typeof this.data[i]==='number'?this.data[i]:data_seq[seq];if(prop.grouping==='stacked'){var indexes=RG.SVG.sequentialIndexToGrouped(i,this.data);var group=indexes[0];var datapiece=indexes[1];if(datapiece!==(this.data[group].length-1)){continue;}else{num=RG.SVG.arraySum(this.data[group]);}}
44
49
  var str=RG.SVG.numberFormat({object:this,num:num.toFixed(prop.labelsAboveDecimals),prepend:typeof prop.labelsAboveUnitsPre==='string'?prop.labelsAboveUnitsPre:null,append:typeof prop.labelsAboveUnitsPost==='string'?prop.labelsAboveUnitsPost:null,point:typeof prop.labelsAbovePoint==='string'?prop.labelsAbovePoint:null,thousand:typeof prop.labelsAboveThousand==='string'?prop.labelsAboveThousand:null,formatter:typeof prop.labelsAboveFormatter==='function'?prop.labelsAboveFormatter:null});if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&(typeof prop.labelsAboveSpecific[seq]==='string'||typeof prop.labelsAboveSpecific[seq]==='number')){str=prop.labelsAboveSpecific[seq];}else if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&typeof prop.labelsAboveSpecific[seq]!=='string'&&typeof prop.labelsAboveSpecific[seq]!=='number'){continue;}
45
- var x=parseFloat(this.coords[i].object.getAttribute('x'))+parseFloat(this.coords[i].object.getAttribute('width')/2)+prop.labelsAboveOffsetx;if(data_seq[i]>=0){var y=parseFloat(this.coords[i].object.getAttribute('y'))-7+prop.labelsAboveOffsety;var valign=prop.labelsAboveValign;}else{var y=parseFloat(this.coords[i].object.getAttribute('y'))+parseFloat(this.coords[i].object.getAttribute('height'))+7-prop.labelsAboveOffsety;var valign=prop.labelsAboveValign==='top'?'bottom':'top';}
46
- RG.SVG.text({object:this,parent:this.svg.all,text:str,x:x,y:y,halign:prop.labelsAboveHalign,valign:valign,font:prop.labelsAboveFont||prop.textFont,size:prop.labelsAboveSize||prop.textSize,bold:prop.labelsAboveBold||prop.textBold,italic:prop.labelsAboveItalic||prop.textItalic,color:prop.labelsAboveColor||prop.textColor,background:prop.labelsAboveBackground||null,padding:prop.labelsAboveBackgroundPadding||0});}}};this.on=function(type,func)
50
+ var x=parseFloat(this.coords[i].element.getAttribute('x'))+parseFloat(this.coords[i].element.getAttribute('width')/2)+prop.labelsAboveOffsetx;if(data_seq[i]>=0){var y=parseFloat(this.coords[i].element.getAttribute('y'))-7+prop.labelsAboveOffsety;var valign=prop.labelsAboveValign;}else{var y=parseFloat(this.coords[i].element.getAttribute('y'))+parseFloat(this.coords[i].element.getAttribute('height'))+7-prop.labelsAboveOffsety;var valign=prop.labelsAboveValign==='top'?'bottom':'top';}
51
+ RG.SVG.text({object:this,parent:this.svg.all,text:str,x:x,y:y,halign:prop.labelsAboveHalign,valign:valign,tag:'labels.above',font:prop.labelsAboveFont||prop.textFont,size:prop.labelsAboveSize||prop.textSize,bold:prop.labelsAboveBold||prop.textBold,italic:prop.labelsAboveItalic||prop.textItalic,color:prop.labelsAboveColor||prop.textColor,background:prop.labelsAboveBackground||null,padding:prop.labelsAboveBackgroundPadding||0});}}};this.on=function(type,func)
47
52
  {if(type.substr(0,2)!=='on'){type='on'+type;}
48
53
  RG.SVG.addCustomEventListener(this,type,func);return this;};this.exec=function(func)
49
54
  {func(this);return this;};this.removeHighlight=function()
50
55
  {var highlight=RG.SVG.REG.get('highlight');if(highlight&&highlight.parentNode){highlight.parentNode.removeChild(highlight);}
51
56
  RG.SVG.REG.set('highlight',null);};this.drawTop3dFace=function(opt)
52
57
  {var rect=opt.rect,arr=[parseInt(rect.getAttribute('fill')),'rgba(255,255,255,0.7)'],x=parseInt(rect.getAttribute('x')),y=parseInt(rect.getAttribute('y')),w=parseInt(rect.getAttribute('width')),h=parseInt(rect.getAttribute('height')),value=parseFloat(rect.getAttribute('data-value'));rect.rgraph_3d_top_face=[];for(var i=0;i<2;++i){var color=(i===0?rect.getAttribute('fill'):'rgba(255,255,255,0.7)');var face=RG.SVG.create({svg:this.svg,type:'path',parent:prop.variant==='3d'&&opt.value<0?this.threed_xaxis_group:this.svg.all,attr:{stroke:prop.strokestyle,fill:color,'stroke-width':prop.linewidth,d:'M {1} {2} L {3} {4} L {5} {6} L {7} {8}'.format(x,y,x+prop.variant3dOffsetx,y-prop.variant3dOffsety,x+w+prop.variant3dOffsetx,y-prop.variant3dOffsety,x+w,y)}});rect.rgraph_3d_top_face[i]=face}};this.drawSide3dFace=function(opt)
53
- {var rect=opt.rect,arr=[parseInt(rect.getAttribute('fill')),'rgba(0,0,0,0.3)'],x=parseInt(rect.getAttribute('x')),y=parseInt(rect.getAttribute('y')),w=parseInt(rect.getAttribute('width')),h=parseInt(rect.getAttribute('height'));rect.rgraph_3d_side_face=[];for(var i=0;i<2;++i){var color=(i===0?rect.getAttribute('fill'):'rgba(0,0,0,0.3)');var face=RG.SVG.create({svg:this.svg,type:'path',parent:prop.variant==='3d'&&opt.value<0?this.threed_xaxis_group:this.svg.all,attr:{stroke:prop.strokestyle,fill:color,'stroke-width':prop.linewidth,d:'M {1} {2} L {3} {4} L {5} {6} L {7} {8}'.format(x+w,y,x+w+prop.variant3dOffsetx,y-prop.variant3dOffsety,x+w+prop.variant3dOffsetx,y+h-prop.variant3dOffsety,x+w,y+h)}});rect.rgraph_3d_side_face[i]=face}};this.grow=function()
58
+ {var rect=opt.rect,arr=[parseInt(rect.getAttribute('fill')),'rgba(0,0,0,0.3)'],x=parseInt(rect.getAttribute('x')),y=parseInt(rect.getAttribute('y')),w=parseInt(rect.getAttribute('width')),h=parseInt(rect.getAttribute('height'));rect.rgraph_3d_side_face=[];for(var i=0;i<2;++i){var color=(i===0?rect.getAttribute('fill'):'rgba(0,0,0,0.3)');var face=RG.SVG.create({svg:this.svg,type:'path',parent:prop.variant==='3d'&&opt.value<0?this.threed_xaxis_group:this.svg.all,attr:{stroke:prop.strokestyle,fill:color,'stroke-width':prop.linewidth,d:'M {1} {2} L {3} {4} L {5} {6} L {7} {8}'.format(x+w,y,x+w+prop.variant3dOffsetx,y-prop.variant3dOffsety,x+w+prop.variant3dOffsetx,y+h-prop.variant3dOffsety,x+w,y+h)}});rect.rgraph_3d_side_face[i]=face}};this.drawErrorbar=function(opt)
59
+ {var prop=this.properties,index=opt.index,datapoint=opt.value,linewidth=RG.SVG.getErrorbarsLinewidth({object:this,index:index}),color=RG.SVG.getErrorbarsColor({object:this,index:index}),capwidth=RG.SVG.getErrorbarsCapWidth({object:this,index:index}),element=opt.element,type=opt.type;var max=RG.SVG.getErrorbarsMaxValue({object:this,index:index});var min=RG.SVG.getErrorbarsMinValue({object:this,index:index});if(!max&&!min){return;}
60
+ if(type==='stacked'){datapoint=RG.SVG.arraySum(this.data[index]);}
61
+ if(datapoint>=0){var x1=parseFloat(element.getAttribute('x'))+(parseFloat(element.getAttribute('width'))/2);var errorbarLine=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:x1,y1:parseFloat(element.getAttribute('y')),x2:x1,y2:this.getYCoord(parseFloat(datapoint+max)),stroke:color,'stroke-width':linewidth}});var errorbarCap=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:parseFloat(errorbarLine.getAttribute('x1'))-(capwidth/2),y1:errorbarLine.getAttribute('y2'),x2:parseFloat(errorbarLine.getAttribute('x1'))+(capwidth/2),y2:errorbarLine.getAttribute('y2'),stroke:color,'stroke-width':linewidth}});if(typeof min==='number'){var errorbarLine=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:x1,y1:parseFloat(element.getAttribute('y')),x2:x1,y2:this.getYCoord(parseFloat(datapoint-min)),stroke:color,'stroke-width':linewidth}});var errorbarCap=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:parseFloat(errorbarLine.getAttribute('x1'))-(capwidth/2),y1:errorbarLine.getAttribute('y2'),x2:parseFloat(errorbarLine.getAttribute('x1'))+(capwidth/2),y2:errorbarLine.getAttribute('y2'),stroke:color,'stroke-width':linewidth}});}}else if(datapoint<0){var x1=parseFloat(element.getAttribute('x'))+(parseFloat(element.getAttribute('width'))/2),y1=parseFloat(element.getAttribute('y'))+parseFloat(element.getAttribute('height')),y2=this.getYCoord(parseFloat(datapoint-ma.abs(max)))
62
+ var errorbarLine=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:x1,y1:y1,x2:x1,y2:y2,stroke:color,'stroke-width':linewidth}});var errorbarCap=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:parseFloat(errorbarLine.getAttribute('x1'))-(capwidth/2),y1:errorbarLine.getAttribute('y2'),x2:parseFloat(errorbarLine.getAttribute('x1'))+(capwidth/2),y2:errorbarLine.getAttribute('y2'),stroke:color,'stroke-width':linewidth}});if(typeof min==='number'){var x1=parseFloat(element.getAttribute('x'))+(parseFloat(element.getAttribute('width'))/2);var errorbarLine=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:x1,y1:this.getYCoord(parseFloat(datapoint+min)),x2:x1,y2:this.getYCoord(parseFloat(datapoint)),stroke:color,'stroke-width':linewidth}});var errorbarCap=RG.SVG.create({svg:this.svg,type:'line',parent:this.svg.all,attr:{x1:parseFloat(errorbarLine.getAttribute('x1'))-(capwidth/2),y1:errorbarLine.getAttribute('y1'),x2:parseFloat(errorbarLine.getAttribute('x1'))+(capwidth/2),y2:errorbarLine.getAttribute('y1'),stroke:color,'stroke-width':linewidth}});}}};this.grow=function()
54
63
  {var opt=arguments[0]||{},frames=opt.frames||30,frame=0,obj=this,data=[],height=null,seq=0;data=RG.SVG.arrayClone(this.data);this.draw();var iterate=function()
55
- {for(var i=0,seq=0,len=obj.coords.length;i<len;++i,++seq){var multiplier=(frame/frames)*RG.SVG.FX.getEasingMultiplier(frames,frame)*RG.SVG.FX.getEasingMultiplier(frames,frame);if(typeof data[i]==='number'){height=ma.abs(obj.getYCoord(data[i])-obj.getYCoord(0));obj.data[i]=data[i]*multiplier;height=multiplier*height;obj.coords[seq].object.setAttribute('height',height);obj.coords[seq].object.setAttribute('y',data[i]<0?obj.getYCoord(0):obj.getYCoord(0)-height);if(prop.variant==='3d'){if(obj.coords[i].object.rgraph_3d_side_face[0].parentNode)obj.coords[i].object.rgraph_3d_side_face[0].parentNode.removeChild(obj.coords[i].object.rgraph_3d_side_face[0]);if(obj.coords[i].object.rgraph_3d_side_face[1].parentNode)obj.coords[i].object.rgraph_3d_side_face[1].parentNode.removeChild(obj.coords[i].object.rgraph_3d_side_face[1]);if(obj.coords[i].object.rgraph_3d_top_face[0].parentNode)obj.coords[i].object.rgraph_3d_top_face[0].parentNode.removeChild(obj.coords[i].object.rgraph_3d_top_face[0]);if(obj.coords[i].object.rgraph_3d_top_face[1].parentNode)obj.coords[i].object.rgraph_3d_top_face[1].parentNode.removeChild(obj.coords[i].object.rgraph_3d_top_face[1]);obj.drawSide3dFace({rect:obj.coords[i].object});if(prop.grouping==='grouped'){obj.drawTop3dFace({rect:obj.coords[i].object});}
56
- if(obj.coords[i].object.parentNode){var parent=obj.coords[i].object.parentNode;var node=parent.removeChild(obj.coords[i].object);parent.appendChild(node);}}}else if(typeof data[i]==='object'){var accumulativeHeight=0;for(var j=0,len2=data[i].length;j<len2;++j,++seq){height=ma.abs(obj.getYCoord(data[i][j])-obj.getYCoord(0));height=multiplier*height;obj.data[i][j]=data[i][j]*multiplier;height=ma.round(height);obj.coords[seq].object.setAttribute('height',height);obj.coords[seq].object.setAttribute('y',data[i][j]<0?(obj.getYCoord(0)+accumulativeHeight):(obj.getYCoord(0)-height-accumulativeHeight));if(prop.variant==='3d'){if(obj.coords[seq].object.rgraph_3d_side_face[0].parentNode)obj.coords[seq].object.rgraph_3d_side_face[0].parentNode.removeChild(obj.coords[seq].object.rgraph_3d_side_face[0]);if(obj.coords[seq].object.rgraph_3d_side_face[1].parentNode)obj.coords[seq].object.rgraph_3d_side_face[1].parentNode.removeChild(obj.coords[seq].object.rgraph_3d_side_face[1]);if(obj.coords[seq].object.rgraph_3d_top_face[0].parentNode)obj.coords[seq].object.rgraph_3d_top_face[0].parentNode.removeChild(obj.coords[seq].object.rgraph_3d_top_face[0]);if(obj.coords[seq].object.rgraph_3d_top_face[1].parentNode)obj.coords[seq].object.rgraph_3d_top_face[1].parentNode.removeChild(obj.coords[seq].object.rgraph_3d_top_face[1]);obj.drawSide3dFace({rect:obj.coords[seq].object});obj.drawTop3dFace({rect:obj.coords[seq].object});if(obj.coords[seq].object.parentNode){var parent=obj.coords[seq].object.parentNode;var node=parent.removeChild(obj.coords[seq].object);parent.appendChild(node);}}
64
+ {for(var i=0,seq=0,len=obj.coords.length;i<len;++i,++seq){var multiplier=(frame/frames)*RG.SVG.FX.getEasingMultiplier(frames,frame)*RG.SVG.FX.getEasingMultiplier(frames,frame);if(typeof data[i]==='number'){height=ma.abs(obj.getYCoord(data[i])-obj.getYCoord(0));obj.data[i]=data[i]*multiplier;height=multiplier*height;obj.coords[seq].element.setAttribute('height',height);obj.coords[seq].element.setAttribute('y',data[i]<0?obj.getYCoord(0):obj.getYCoord(0)-height);if(prop.variant==='3d'){if(obj.coords[i].element.rgraph_3d_side_face[0].parentNode)obj.coords[i].element.rgraph_3d_side_face[0].parentNode.removeChild(obj.coords[i].element.rgraph_3d_side_face[0]);if(obj.coords[i].element.rgraph_3d_side_face[1].parentNode)obj.coords[i].element.rgraph_3d_side_face[1].parentNode.removeChild(obj.coords[i].element.rgraph_3d_side_face[1]);if(obj.coords[i].element.rgraph_3d_top_face[0].parentNode)obj.coords[i].element.rgraph_3d_top_face[0].parentNode.removeChild(obj.coords[i].element.rgraph_3d_top_face[0]);if(obj.coords[i].element.rgraph_3d_top_face[1].parentNode)obj.coords[i].element.rgraph_3d_top_face[1].parentNode.removeChild(obj.coords[i].element.rgraph_3d_top_face[1]);obj.drawSide3dFace({rect:obj.coords[i].element});if(prop.grouping==='grouped'){obj.drawTop3dFace({rect:obj.coords[i].element});}
65
+ if(obj.coords[i].element.parentNode){var parent=obj.coords[i].element.parentNode;var node=parent.removeChild(obj.coords[i].element);parent.appendChild(node);}}}else if(typeof data[i]==='object'){var accumulativeHeight=0;for(var j=0,len2=data[i].length;j<len2;++j,++seq){height=ma.abs(obj.getYCoord(data[i][j])-obj.getYCoord(0));height=multiplier*height;obj.data[i][j]=data[i][j]*multiplier;height=ma.round(height);obj.coords[seq].element.setAttribute('height',height);obj.coords[seq].element.setAttribute('y',data[i][j]<0?(obj.getYCoord(0)+accumulativeHeight):(obj.getYCoord(0)-height-accumulativeHeight));if(prop.variant==='3d'){if(obj.coords[seq].element.rgraph_3d_side_face[0].parentNode)obj.coords[seq].element.rgraph_3d_side_face[0].parentNode.removeChild(obj.coords[seq].element.rgraph_3d_side_face[0]);if(obj.coords[seq].element.rgraph_3d_side_face[1].parentNode)obj.coords[seq].element.rgraph_3d_side_face[1].parentNode.removeChild(obj.coords[seq].element.rgraph_3d_side_face[1]);if(obj.coords[seq].element.rgraph_3d_top_face[0].parentNode)obj.coords[seq].element.rgraph_3d_top_face[0].parentNode.removeChild(obj.coords[seq].element.rgraph_3d_top_face[0]);if(obj.coords[seq].element.rgraph_3d_top_face[1].parentNode)obj.coords[seq].element.rgraph_3d_top_face[1].parentNode.removeChild(obj.coords[seq].element.rgraph_3d_top_face[1]);obj.drawSide3dFace({rect:obj.coords[seq].element});obj.drawTop3dFace({rect:obj.coords[seq].element});if(obj.coords[seq].element.parentNode){var parent=obj.coords[seq].element.parentNode;var node=parent.removeChild(obj.coords[seq].element);parent.appendChild(node);}}
57
66
  accumulativeHeight+=(prop.grouping==='stacked'?height:0);}
58
67
  if(obj.stackedBackfaces[i]){obj.stackedBackfaces[i].setAttribute('height',accumulativeHeight);obj.stackedBackfaces[i].setAttribute('y',obj.height-prop.gutterBottom-accumulativeHeight);}
59
68
  --seq;}}
60
69
  if(frame++<frames){RG.SVG.FX.update(iterate);}else if(opt.callback){(opt.callback)(obj);}};iterate();return this;};this.wave=function()
61
- {this.draw();var obj=this,opt=arguments[0]||{};opt.frames=opt.frames||60;opt.startFrames=[];opt.counters=[];var framesperbar=opt.frames/3,frame=-1,callback=opt.callback||function(){};for(var i=0,len=this.coords.length;i<len;i+=1){opt.startFrames[i]=((opt.frames/2)/(obj.coords.length-1))*i;opt.counters[i]=0;this.coords[i].object.setAttribute('height',0);if(this.coords[i].object.rgraph_3d_side_face){var parent=this.coords[i].object.rgraph_3d_side_face[0].parentNode;parent.removeChild(this.coords[i].object.rgraph_3d_side_face[0]);parent.removeChild(this.coords[i].object.rgraph_3d_side_face[1]);parent.removeChild(this.coords[i].object.rgraph_3d_top_face[0]);parent.removeChild(this.coords[i].object.rgraph_3d_top_face[1]);}}
70
+ {this.draw();var obj=this,opt=arguments[0]||{};opt.frames=opt.frames||60;opt.startFrames=[];opt.counters=[];var framesperbar=opt.frames/3,frame=-1,callback=opt.callback||function(){};for(var i=0,len=this.coords.length;i<len;i+=1){opt.startFrames[i]=((opt.frames/2)/(obj.coords.length-1))*i;opt.counters[i]=0;this.coords[i].element.setAttribute('height',0);if(this.coords[i].element.rgraph_3d_side_face){var parent=this.coords[i].element.rgraph_3d_side_face[0].parentNode;parent.removeChild(this.coords[i].element.rgraph_3d_side_face[0]);parent.removeChild(this.coords[i].element.rgraph_3d_side_face[1]);parent.removeChild(this.coords[i].element.rgraph_3d_top_face[0]);parent.removeChild(this.coords[i].element.rgraph_3d_top_face[1]);}}
62
71
  function iterator()
63
- {++frame;for(var i=0,len=obj.coords.length;i<len;i+=1){if(frame>opt.startFrames[i]){var originalHeight=obj.coords[i].object.getAttribute('data-original-height'),height,value=parseFloat(obj.coords[i].object.getAttribute('data-value'));var height=ma.min(((frame-opt.startFrames[i])/framesperbar)*originalHeight,originalHeight);obj.coords[i].object.setAttribute('height',height<0?0:height);obj.coords[i].object.setAttribute('y',value>=0?obj.getYCoord(0)-height:obj.getYCoord(0));if(prop.variant==='3d'){var parent=obj.coords[i].object.rgraph_3d_side_face[0].parentNode;if(parent)parent.removeChild(obj.coords[i].object.rgraph_3d_side_face[0]);if(parent)parent.removeChild(obj.coords[i].object.rgraph_3d_side_face[1]);var parent=obj.coords[i].object.rgraph_3d_top_face[0].parentNode;if(parent)parent.removeChild(obj.coords[i].object.rgraph_3d_top_face[0]);if(parent)parent.removeChild(obj.coords[i].object.rgraph_3d_top_face[1]);if(obj.coords[i].object.parentNode){var parent=obj.coords[i].object.parentNode;var node=parent.removeChild(obj.coords[i].object);parent.appendChild(node);}}
64
- if(prop.grouping==='stacked'){var seq=obj.coords[i].object.getAttribute('data-sequential-index');var indexes=RG.SVG.sequentialIndexToGrouped(seq,obj.data);if(indexes[1]>0){obj.coords[i].object.setAttribute('y',parseInt(obj.coords[i-1].object.getAttribute('y'))-height);}}
65
- if(prop.variant==='3d'){obj.drawSide3dFace({rect:obj.coords[i].object,value:obj.coords[i].object.getAttribute('data-value')});if(prop.grouping==='grouped'||(prop.grouping==='stacked'&&(indexes[1]+1)===obj.data[indexes[0]].length)){obj.drawTop3dFace({rect:obj.coords[i].object,value:obj.coords[i].object.getAttribute('data-value')});}}}}
72
+ {++frame;for(var i=0,len=obj.coords.length;i<len;i+=1){if(frame>opt.startFrames[i]){var originalHeight=obj.coords[i].element.getAttribute('data-original-height'),height,value=parseFloat(obj.coords[i].element.getAttribute('data-value'));var height=ma.min(((frame-opt.startFrames[i])/framesperbar)*originalHeight,originalHeight);obj.coords[i].element.setAttribute('height',height<0?0:height);obj.coords[i].element.setAttribute('y',value>=0?obj.getYCoord(0)-height:obj.getYCoord(0));if(prop.variant==='3d'){var parent=obj.coords[i].element.rgraph_3d_side_face[0].parentNode;if(parent)parent.removeChild(obj.coords[i].element.rgraph_3d_side_face[0]);if(parent)parent.removeChild(obj.coords[i].element.rgraph_3d_side_face[1]);var parent=obj.coords[i].element.rgraph_3d_top_face[0].parentNode;if(parent)parent.removeChild(obj.coords[i].element.rgraph_3d_top_face[0]);if(parent)parent.removeChild(obj.coords[i].element.rgraph_3d_top_face[1]);if(obj.coords[i].element.parentNode){var parent=obj.coords[i].element.parentNode;var node=parent.removeChild(obj.coords[i].element);parent.appendChild(node);}}
73
+ if(prop.grouping==='stacked'){var seq=obj.coords[i].element.getAttribute('data-sequential-index');var indexes=RG.SVG.sequentialIndexToGrouped(seq,obj.data);if(indexes[1]>0){obj.coords[i].element.setAttribute('y',parseInt(obj.coords[i-1].element.getAttribute('y'))-height);}}
74
+ if(prop.variant==='3d'){obj.drawSide3dFace({rect:obj.coords[i].element,value:obj.coords[i].element.getAttribute('data-value')});if(prop.grouping==='grouped'||(prop.grouping==='stacked'&&(indexes[1]+1)===obj.data[indexes[0]].length)){obj.drawTop3dFace({rect:obj.coords[i].element,value:obj.coords[i].element.getAttribute('data-value')});}}}}
66
75
  if(frame>=opt.frames){callback(obj);}else{RG.SVG.FX.update(iterator);}}
67
76
  iterator();return this;};for(i in conf.options){if(typeof i==='string'){this.set(i,conf.options[i]);}}};return this;})(window,document);
@@ -0,0 +1,104 @@
1
+
2
+ RGraph=window.RGraph||{isRGraph:true};RGraph.SVG=RGraph.SVG||{};(function(win,doc,undefined)
3
+ {var RG=RGraph,ua=navigator.userAgent,ma=Math,win=window,doc=document;RG.SVG.Bipolar=function(conf)
4
+ {this.set=function(name,value)
5
+ {if(arguments.length===1&&typeof name==='object'){for(i in arguments[0]){if(typeof i==='string'){var ret=RG.SVG.commonSetter({object:this,name:i,value:arguments[0][i]});name=ret.name;value=ret.value;this.set(name,value);}}}else{var ret=RG.SVG.commonSetter({object:this,name:name,value:value});name=ret.name;value=ret.value;this.properties[name]=value;if(name==='colors'){this.originalColors=RG.SVG.arrayClone(value);this.colorsParsed=false;}}
6
+ return this;};this.id=conf.id;this.uid=RG.SVG.createUID();this.container=document.getElementById(this.id);this.layers={};this.svg=RG.SVG.createSVG({object:this,container:this.container});this.isRGraph=true;this.data=[conf.left,conf.right];this.left=conf.left;this.right=conf.right;this.type='bipolar';this.coords=[];this.coordsLeft=[];this.coordsRight=[];this.coords2=[];this.coords2Left=[];this.coords2Right=[];this.stackedBackfacesLeft=[];this.stackedBackfacesRight=[];this.originalColors={};this.gradientCounter=1;this.sequentialIndex=0;RG.SVG.OR.add(this);this.container.style.display='inline-block';this.properties={gutterLeft:35,gutterRight:35,gutterTop:35,gutterBottom:35,gutterCenter:null,backgroundColor:null,backgroundGrid:true,backgroundGridColor:'#ddd',backgroundGridLinewidth:1,backgroundGridHlines:true,backgroundGridHlinesCount:null,backgroundGridVlines:true,backgroundGridVlinesCount:null,backgroundGridBorder:true,backgroundGridDashed:false,backgroundGridDotted:false,backgroundGridDashArray:null,xaxis:true,xaxisLinewidth:1,xaxisTickmarks:true,xaxisTickmarksLength:5,xaxisLabelsCount:5,xaxisLabelsPositionEdgeTickmarksCount:5,xaxisColor:'black',xaxisLabelsOffsetx:0,xaxisLabelsOffsety:0,xaxisUnitsPre:'',xaxisUnitsPost:'',xaxisStrict:false,xaxisDecimals:0,xaxisPoint:'.',xaxisThousand:',',xaxisRound:false,xaxisMax:null,xaxisMin:0,xaxisFormatter:null,xaxisTextFont:null,xaxisTextSize:null,xaxisTextBold:null,xaxisTextItalic:null,xaxisTextColor:null,yaxis:true,yaxisTickmarks:true,yaxisTickmarksLength:5,yaxisColor:'black',yaxisScale:false,yaxisLabels:null,yaxisLabelsOffsetx:0,yaxisLabelsOffsety:0,yaxisTextFont:null,yaxisTextSize:null,yaxisTextBold:null,yaxisTextItalic:null,yaxisTextColor:null,colors:['red','#0f0','#00f','#ff0','#0ff','#0f0','pink','orange','gray','black','red','#0f0','#00f','#ff0','#0ff','#0f0','pink','orange','gray','black'],colorsSequential:false,strokestyle:'rgba(0,0,0,0)',vmargin:3,vmarginGrouped:2,labelsAbove:false,labelsAboveFont:null,labelsAboveSize:null,labelsAboveBold:null,labelsAboveItalic:null,labelsAboveColor:null,labelsAboveBackground:null,labelsAboveBackgroundPadding:0,labelsAboveUnitsPre:null,labelsAboveUnitsPost:null,labelsAbovePoint:null,labelsAboveThousand:null,labelsAboveFormatter:null,labelsAboveDecimals:null,labelsAboveOffsetx:0,labelsAboveOffsety:0,labelsAboveSpecific:null,textColor:'black',textFont:'sans-serif',textSize:12,textBold:false,textItalic:false,linewidth:1,grouping:'grouped',tooltips:null,tooltipsOverride:null,tooltipsEffect:'fade',tooltipsCssClass:'RGraph_tooltip',tooltipsEvent:'click',highlightStroke:'rgba(0,0,0,0)',highlightFill:'rgba(255,255,255,0.7)',highlightLinewidth:1,title:'',titleSize:16,titleX:null,titleY:null,titleHalign:'center',titleValign:null,titleColor:'black',titleFont:null,titleBold:false,titleItalic:false,titleSubtitle:null,titleSubtitleSize:10,titleSubtitleX:null,titleSubtitleY:null,titleSubtitleHalign:'center',titleSubtitleValign:null,titleSubtitleColor:'#aaa',titleSubtitleFont:null,titleSubtitleBold:false,titleSubtitleItalic:false,shadow:false,shadowOffsetx:2,shadowOffsety:2,shadowBlur:2,shadowOpacity:0.25,key:null,keyColors:null,keyOffsetx:0,keyOffsety:0,keyTextOffsetx:0,keyTextOffsety:-1,keyTextSize:null,keyTextBold:null,keyTextItalic:null,keyTextFont:null};RG.SVG.getGlobals(this);if(RG.SVG.FX&&typeof RG.SVG.FX.decorate==='function'){RG.SVG.FX.decorate(this);}
7
+ var prop=this.properties;this.draw=function()
8
+ {RG.SVG.fireCustomEvent(this,'onbeforedraw');this.width=Number(this.svg.getAttribute('width'));this.height=Number(this.svg.getAttribute('height'));RG.SVG.createDefs(this);if(typeof prop.gutterCenter!=='number'){prop.gutterCenter=this.getGutterCenter();}
9
+ this.coords=[];this.coordsLeft=[];this.coordsRight=[];this.coords2=[];this.coords2Left=[];this.coords2Right=[];this.graphWidth=(this.width-prop.gutterLeft-prop.gutterRight-prop.gutterCenter)/2;this.graphHeight=this.height-prop.gutterTop-prop.gutterBottom;RG.SVG.resetColorsToOriginalValues({object:this});this.parseColors();var values=[];for(var i=0;i<2;++i){for(var j=0,max=0;j<this.data[i].length;++j){if(typeof this.data[i][j]==='number'){values.push(this.data[i][j]);}else if(RG.SVG.isArray(this.data[i][j])&&prop.grouping==='grouped'){values.push(RG.SVG.arrayMax(this.data[i][j]));}else if(RG.SVG.isArray(this.data[i][j])&&prop.grouping==='stacked'){values.push(RG.SVG.arraySum(this.data[i][j]));}}}
10
+ var max=RG.SVG.arrayMax(values);if(typeof prop.xaxisMax==='number'){max=prop.xaxisMax;}
11
+ this.scale=RG.SVG.getScale({object:this,numlabels:prop.xaxisLabelsCount,unitsPre:prop.xaxisUnitsPre,unitsPost:prop.xaxisUnitsPost,max:max,min:prop.xaxisMin,point:prop.xaxisPoint,round:prop.xaxisRound,thousand:prop.xaxisThousand,decimals:prop.xaxisDecimals,strict:typeof prop.xaxisMax==='number',formatter:prop.xaxisFormatter});this.max=this.scale.max;this.min=this.scale.min;prop.yaxisMax=this.scale.max;prop.yaxisMin=this.scale.min;this.drawBackground(this);this.drawTitle();this.drawBars();this.drawAxes();this.drawLabels()
12
+ this.drawLabelsAbove();if(typeof prop.key!==null&&RG.SVG.drawKey){RG.SVG.drawKey(this);}else if(!RG.SVG.isNull(prop.key)){alert('The drawKey() function does not exist - have you forgotten to include the key library?');}
13
+ RG.SVG.fireCustomEvent(this,'ondraw');return this;};this.drawBackground=function()
14
+ {var originalGutterRight=prop.gutterRight,originalGutterLeft=prop.gutterLeft;prop.gutterRight=this.width-(prop.gutterLeft+this.graphWidth);if(RG.SVG.isNull(prop.backgroundGridHlinesCount)){var resetToNull=true;prop.backgroundGridHlinesCount=this.left.length;}
15
+ var properties=['','Aspect','Opacity','Stretch','X','Y','W','H',];for(i in properties){if(typeof properties[i]==='string'){prop['backgroundImage'+properties[i]]=prop['backgroundImageLeft'+properties[i]];}}
16
+ RG.SVG.drawBackground(this);if(resetToNull){prop.backgroundGridHlinesCount=null;}
17
+ prop.gutterRight=originalGutterRight;prop.gutterLeft=this.width-(prop.gutterRight+this.graphWidth);if(RG.SVG.isNull(prop.backgroundGridHlinesCount)){prop.backgroundGridHlinesCount=this.right.length;}
18
+ var properties=['','Aspect','Opacity','Stretch','X','Y','W','H',];for(i in properties){if(typeof properties[i]==='string'){prop['backgroundImage'+properties[i]]=prop['backgroundImageRight'+properties[i]];}}
19
+ RG.SVG.drawBackground(this);prop.gutterLeft=originalGutterLeft;prop.gutterRight=originalGutterRight;};this.drawAxes=function()
20
+ {if(prop.xaxis){RG.SVG.create({svg:this.svg,type:'path',parent:this.svg.all,attr:{d:'M {1} {2} L {3} {4}'.format(prop.gutterLeft,this.height-prop.gutterBottom,prop.gutterLeft+this.graphWidth,this.height-prop.gutterBottom),'stroke-width':prop.xaxisLinewidth,stroke:prop.xaxisColor,fill:'rgba(0,0,0,0)','shape-rendering':'crispEdges'}});RG.SVG.create({svg:this.svg,type:'path',parent:this.svg.all,attr:{d:'M {1} {2} L {3} {4}'.format(this.width-prop.gutterRight,this.height-prop.gutterBottom,this.width-prop.gutterRight-this.graphWidth,this.height-prop.gutterBottom),'stroke-width':prop.xaxisLinewidth,stroke:prop.xaxisColor,fill:'rgba(0,0,0,0)','shape-rendering':'crispEdges'}});if(prop.xaxisTickmarks){var startY=this.height-prop.gutterBottom,endY=this.height-prop.gutterBottom+prop.xaxisTickmarksLength;for(var i=0;i<prop.xaxisLabelsPositionEdgeTickmarksCount;++i){var x=prop.gutterLeft+(i*(this.graphWidth/prop.xaxisLabelsPositionEdgeTickmarksCount));RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x+0.001,startY,x,endY),stroke:prop.xaxisColor,'stroke-width':prop.xaxisLinewidth,'shape-rendering':"crispEdges"}});}
21
+ if(!prop.yaxis){var x=prop.gutterLeft+this.graphWidth;RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x+0.001,startY,x,endY),stroke:prop.xaxisColor,'stroke-width':prop.xaxisLinewidth,'shape-rendering':"crispEdges"}});}
22
+ for(var i=0;i<prop.xaxisLabelsPositionEdgeTickmarksCount;++i){var x=prop.gutterLeft+prop.gutterCenter+this.graphWidth+((i+1)*(this.graphWidth/prop.xaxisLabelsPositionEdgeTickmarksCount));RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x+0.001,startY,x,endY),stroke:prop.xaxisColor,'stroke-width':prop.xaxisLinewidth,'shape-rendering':"crispEdges"}});}
23
+ if(!prop.yaxis){var x=prop.gutterLeft+this.graphWidth+prop.gutterCenter;RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x+0.001,startY,x,endY),stroke:prop.xaxisColor,'stroke-width':prop.xaxisLinewidth,'shape-rendering':"crispEdges"}});}}}
24
+ if(prop.yaxis){RG.SVG.create({svg:this.svg,type:'path',parent:this.svg.all,attr:{d:'M {1} {2} L {3} {4}'.format(prop.gutterLeft+this.graphWidth,this.height-prop.gutterBottom,prop.gutterLeft+this.graphWidth,prop.gutterTop),'stroke-width':prop.yaxisLinewidth,stroke:prop.yaxisColor,fill:'rgba(0,0,0,0)','shape-rendering':'crispEdges','stroke-linecap':'square'}});RG.SVG.create({svg:this.svg,type:'path',parent:this.svg.all,attr:{d:'M {1} {2} L {3} {4}'.format(prop.gutterLeft+this.graphWidth+prop.gutterCenter,this.height-prop.gutterBottom,prop.gutterLeft+this.graphWidth+prop.gutterCenter,prop.gutterTop),'stroke-width':prop.yaxisLinewidth,stroke:prop.yaxisColor,fill:'rgba(0,0,0,0)','shape-rendering':'crispEdges','stroke-linecap':'square'}});if(prop.yaxisTickmarks){var startX=prop.gutterLeft+this.graphWidth,endX=prop.gutterLeft+this.graphWidth+prop.yaxisTickmarksLength,numticks=this.left.length;for(var i=0;i<numticks;++i){var y=prop.gutterTop+(i*(this.graphHeight/numticks));RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(startX+0.001,y,endX,y),stroke:prop.yaxisColor,'stroke-width':prop.yaxisLinewidth,'shape-rendering':"crispEdges"}});}
25
+ if(!prop.xaxis){var y=prop.gutterTop+this.graphHeight;RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(startX+0.001,y,endX,y),stroke:prop.yaxisColor,'stroke-width':prop.yaxisLinewidth,'shape-rendering':"crispEdges"}});}
26
+ var startX=prop.gutterLeft+this.graphWidth+prop.gutterCenter,endX=prop.gutterLeft+this.graphWidth+prop.gutterCenter-prop.yaxisTickmarksLength,numticks=this.right.length;for(var i=0;i<numticks;++i){var y=prop.gutterTop+(i*(this.graphHeight/numticks));RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(startX+0.001,y,endX,y),stroke:prop.yaxisColor,'stroke-width':prop.yaxisLinewidth,'shape-rendering':"crispEdges"}});}
27
+ if(!prop.xaxis){var y=prop.gutterTop+this.graphHeight;RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(startX+0.001,y,endX,y),stroke:prop.yaxisColor,'stroke-width':prop.yaxisLinewidth,'shape-rendering':"crispEdges"}});}}}};this.drawLabels=function()
28
+ {var numlabels=prop.yaxisLabels?prop.yaxisLabels.length:5
29
+ for(var i=0;i<numlabels;++i){var segment=this.graphHeight/numlabels,y=prop.gutterTop+(segment*i)+(segment/2)+prop.yaxisLabelsOffsety,x=prop.gutterLeft+this.graphWidth+(prop.gutterCenter/2)+prop.yaxisLabelsOffsetx;var text=RG.SVG.text({object:this,parent:this.svg.all,text:prop.yaxisLabels&&prop.yaxisLabels[i]?prop.yaxisLabels[i]:'',x:x,y:y,halign:'center',valign:'center',tag:'labels.yaxis',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:!RG.SVG.isNull(prop.yaxisTextBold)?prop.yaxisTextBold:prop.textBold,italic:!RG.SVG.isNull(prop.yaxisTextItalic)?prop.yaxisTextItalic:prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}
30
+ var segment=this.graphWidth/prop.xaxisLabelsCount;for(var i=0;i<this.scale.labels.length;++i){RG.SVG.text({object:this,parent:this.svg.all,text:this.scale.labels[i],x:prop.gutterLeft+this.graphWidth-(segment*(i+1))+prop.xaxisLabelsOffsetx,y:this.height-prop.gutterBottom+10+prop.xaxisLabelsOffsety,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:typeof prop.xaxisTextBold==='boolean'?prop.xaxisTextBold:prop.textBold,italic:typeof prop.xaxisTextItalic==='boolean'?prop.xaxisTextItalic:prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}
31
+ var y=this.height-prop.gutterBottom+10,str=(prop.xaxisUnitsPre+prop.xaxisMin.toFixed(prop.xaxisDecimals).replace(/\./,prop.xaxisPoint)+prop.xaxisUnitsPost);var text=RG.SVG.text({object:this,parent:this.svg.all,text:str,x:prop.gutterLeft+this.graphWidth+prop.xaxisLabelsOffsetx,y:y+prop.xaxisLabelsOffsety,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:typeof prop.xaxisTextBold==='boolean'?prop.xaxisTextBold:prop.textBold,italic:typeof prop.xaxisTextItalic==='boolean'?prop.xaxisTextItalic:prop.textItalic,color:prop.xaxisTextColor||prop.textColor});for(var i=0;i<this.scale.labels.length;++i){RG.SVG.text({object:this,parent:this.svg.all,text:this.scale.labels[i],x:prop.gutterLeft+this.graphWidth+prop.gutterCenter+(segment*(i+1))+prop.xaxisLabelsOffsetx,y:this.height-prop.gutterBottom+10+prop.xaxisLabelsOffsety,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:typeof prop.xaxisTextBold==='boolean'?prop.xaxisTextBold:prop.textBold,italic:typeof prop.xaxisTextItalic==='boolean'?prop.xaxisTextItalic:prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}
32
+ var text=RG.SVG.text({object:this,parent:this.svg.all,text:prop.xaxisUnitsPre+prop.xaxisMin.toFixed(prop.xaxisDecimals).replace(/\./,prop.xaxisPoint)+prop.xaxisUnitsPost,x:prop.gutterLeft+this.graphWidth+prop.gutterCenter+prop.xaxisLabelsOffsetx,y:this.height-prop.gutterBottom+10+prop.xaxisLabelsOffsety,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:typeof prop.xaxisTextBold==='boolean'?prop.xaxisTextBold:prop.textBold,italic:typeof prop.xaxisTextItalic==='boolean'?prop.xaxisTextItalic:prop.textItalic,color:prop.xaxisTextColor||prop.textColor});};this.drawBars=function()
33
+ {if(prop.shadow){RG.SVG.setShadow({object:this,offsetx:prop.shadowOffsetx,offsety:prop.shadowOffsety,blur:prop.shadowBlur,opacity:prop.shadowOpacity,id:'dropShadow'});}
34
+ for(var i=0;i<this.left.length;++i){if(typeof this.left[i]==='number'){var color=prop.colors[this.sequentialIndex],tooltip=RG.SVG.isNull(prop.tooltips)?null:prop.tooltips[this.sequentialIndex],y=prop.gutterTop+((this.graphHeight/this.left.length)*i)+prop.vmargin,width=this.getWidth(this.left[i]),x=prop.gutterLeft+this.graphWidth-width,height=(this.graphHeight/this.left.length)-prop.vmargin-prop.vmargin;var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{x:x,y:y,width:width,height:height,fill:prop.colorsSequential?prop.colors[this.sequentialIndex]:prop.colors[0],stroke:prop.strokestyle,'stroke-width':prop.linewidth,'shape-rendering':'crispEdges','data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltop':(tooltip||''),'data-index':i,'data-sequential-index':this.sequentialIndex,'data-value':this.left[i],filter:prop.shadow?'url(#dropShadow)':''}});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coordsLeft.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.installTooltipsEventListeners({rect:rect,index:i,sequentialIndex:this.sequentialIndex});this.sequentialIndex++;}else if(RG.SVG.isArray(this.left[i])&&prop.grouping==='stacked'){var accWidth=0;for(var j=0;j<this.left[i].length;++j){var color=prop.colors[this.sequentialIndex],tooltip=RG.SVG.isNull(prop.tooltips)?null:prop.tooltips[this.sequentialIndex],y=prop.gutterTop+((this.graphHeight/this.left.length)*i)+prop.vmargin,width=this.getWidth(this.left[i][j]),accWidth=accWidth+width,x=prop.gutterLeft+this.graphWidth-accWidth,height=(this.graphHeight/this.left.length)-prop.vmargin-prop.vmargin;if(j===0&&prop.shadow){var shadowBackfaceX=prop.gutterLeft+this.graphWidth-this.getWidth(RG.SVG.arraySum(this.left[i])),shadowBackfaceWidth=this.getWidth(RG.SVG.arraySum(this.left[i]));var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{fill:'#eee',x:shadowBackfaceX,y:y,width:shadowBackfaceWidth,height:height,'stroke-width':0,'data-index':i,filter:'url(#dropShadow)'}});this.stackedBackfacesLeft[i]=rect;}
35
+ var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{x:x,y:y,width:width,height:height,fill:prop.colorsSequential?prop.colors[this.sequentialIndex]:prop.colors[j],stroke:prop.strokestyle,'stroke-width':prop.linewidth,'shape-rendering':'crispEdges','data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltop':(tooltip||''),'data-index':i,'data-subindex':j,'data-sequential-index':this.sequentialIndex,'data-value':this.left[i][j]}});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coordsLeft.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[i]){this.coords2[i]=[];}
36
+ if(!this.coords2Left[i]){this.coords2Left[i]=[];}
37
+ this.coords2[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coords2Left[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.installTooltipsEventListeners({rect:rect,index:i,sequentialIndex:this.sequentialIndex});this.sequentialIndex++;}}else if(RG.SVG.isArray(this.left[i])&&prop.grouping==='grouped'){for(var j=0;j<this.left[i].length;++j){var color=prop.colors[this.sequentialIndex],tooltip=RG.SVG.isNull(prop.tooltips)?null:prop.tooltips[this.sequentialIndex],height=((this.graphHeight/this.left.length)-prop.vmargin-prop.vmargin-(prop.vmarginGrouped*(this.left[i].length-1)))/this.left[i].length,y=prop.gutterTop+((this.graphHeight/this.left.length)*i)+prop.vmargin+(height*j)+(j*prop.vmarginGrouped),width=this.getWidth(this.left[i][j]),x=prop.gutterLeft+this.graphWidth-width;var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{x:x,y:y,width:width,height:height,fill:prop.colorsSequential?prop.colors[this.sequentialIndex]:prop.colors[j],stroke:prop.strokestyle,'stroke-width':prop.linewidth,'shape-rendering':'crispEdges','data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltop':(tooltip||''),'data-index':i,'data-subindex':j,'data-sequential-index':this.sequentialIndex,'data-value':this.left[i][j],filter:prop.shadow?'url(#dropShadow)':''}});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coordsLeft.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[i]){this.coords2[i]=[];}
38
+ if(!this.coords2Left[i]){this.coords2Left[i]=[];}
39
+ this.coords2[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coords2Left[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.installTooltipsEventListeners({rect:rect,index:i,sequentialIndex:this.sequentialIndex});this.sequentialIndex++;}}}
40
+ for(var i=0;i<this.right.length;++i){if(typeof this.right[i]==='number'){var color=prop.colors[this.sequentialIndex],tooltip=RG.SVG.isNull(prop.tooltips)?null:prop.tooltips[this.sequentialIndex],y=prop.gutterTop+((this.graphHeight/this.right.length)*i)+prop.vmargin,width=this.getWidth(this.right[i]),x=prop.gutterLeft+this.graphWidth+prop.gutterCenter,height=(this.graphHeight/this.right.length)-prop.vmargin-prop.vmargin;var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{x:x,y:y,width:width,height:height,fill:prop.colorsSequential?prop.colors[this.sequentialIndex]:prop.colors[0],stroke:prop.strokestyle,'stroke-width':prop.linewidth,'shape-rendering':'crispEdges','data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltop':(tooltip||''),'data-index':i,'data-sequential-index':this.sequentialIndex,'data-value':this.right[i],filter:prop.shadow?'url(#dropShadow)':''}});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coordsRight.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.installTooltipsEventListeners({rect:rect,index:i,sequentialIndex:this.sequentialIndex});this.sequentialIndex++;}else if(RG.SVG.isArray(this.right[i])&&prop.grouping==='stacked'){var accWidth=0;for(var j=0;j<this.right[i].length;++j){var color=prop.colors[this.sequentialIndex],tooltip=RG.SVG.isNull(prop.tooltips)?null:prop.tooltips[this.sequentialIndex],y=prop.gutterTop+((this.graphHeight/this.right.length)*i)+prop.vmargin,width=this.getWidth(this.right[i][j]),x=prop.gutterLeft+this.graphWidth+prop.gutterCenter+accWidth,accWidth=accWidth+width,height=(this.graphHeight/this.left.length)-prop.vmargin-prop.vmargin;if(j===0&&prop.shadow){var shadowBackfaceX=prop.gutterLeft+this.graphWidth+prop.gutterCenter,shadowBackfaceWidth=this.getWidth(RG.SVG.arraySum(this.right[i]));var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{fill:'#eee',x:shadowBackfaceX,y:y,width:shadowBackfaceWidth,height:height,'stroke-width':0,'data-index':i,filter:'url(#dropShadow)'}});this.stackedBackfacesRight[i]=rect;}
41
+ var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{x:x,y:y,width:width,height:height,fill:prop.colorsSequential?prop.colors[this.sequentialIndex]:prop.colors[j],stroke:prop.strokestyle,'stroke-width':prop.linewidth,'shape-rendering':'crispEdges','data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltop':(tooltip||''),'data-index':i,'data-subindex':j,'data-sequential-index':this.sequentialIndex,'data-value':this.right[i][j]}});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coordsRight.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[i+this.left.length]){this.coords2[i+this.left.length]=[];}
42
+ if(!this.coords2Right[i]){this.coords2Right[i]=[];}
43
+ this.coords2[i+this.left.length].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coords2Right[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.installTooltipsEventListeners({rect:rect,index:i,sequentialIndex:this.sequentialIndex});this.sequentialIndex++;}}else if(RG.SVG.isArray(this.right[i])&&prop.grouping==='grouped'){for(var j=0;j<this.right[i].length;++j){var color=prop.colors[this.sequentialIndex],tooltip=RG.SVG.isNull(prop.tooltips)?null:prop.tooltips[this.sequentialIndex],height=((this.graphHeight/this.right.length)-prop.vmargin-prop.vmargin-(prop.vmarginGrouped*(this.right[i].length-1)))/this.right[i].length,y=prop.gutterTop+((this.graphHeight/this.right.length)*i)+prop.vmargin+(height*j)+(j*prop.vmarginGrouped),width=this.getWidth(this.right[i][j]),x=prop.gutterLeft+this.graphWidth+prop.gutterCenter;var rect=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{x:x,y:y,width:width,height:height,fill:prop.colorsSequential?prop.colors[this.sequentialIndex]:prop.colors[j],stroke:prop.strokestyle,'stroke-width':prop.linewidth,'shape-rendering':'crispEdges','data-original-x':x,'data-original-y':y,'data-original-width':width,'data-original-height':height,'data-tooltop':(tooltip||''),'data-index':i,'data-subindex':j,'data-sequential-index':this.sequentialIndex,'data-value':this.right[i][j],filter:prop.shadow?'url(#dropShadow)':''}});this.coords.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coordsRight.push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});if(!this.coords2[i+this.left.length]){this.coords2[i+this.left.length]=[];}
44
+ if(!this.coords2Right[i]){this.coords2Right[i]=[];}
45
+ this.coords2[i+this.left.length].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.coords2Right[i].push({object:this,element:rect,x:parseFloat(rect.getAttribute('x')),y:parseFloat(rect.getAttribute('y')),width:parseFloat(rect.getAttribute('width')),height:parseFloat(rect.getAttribute('height'))});this.installTooltipsEventListeners({rect:rect,index:i,sequentialIndex:this.sequentialIndex});this.sequentialIndex++;}}}};this.installTooltipsEventListeners=function(opt)
46
+ {var obj=this;if(!RG.SVG.isNull(prop.tooltips)&&prop.tooltips[this.sequentialIndex]){(function(idx,seq)
47
+ {opt.rect.addEventListener(prop.tooltipsEvent.replace(/^on/,''),function(e)
48
+ {obj.removeHighlight();RG.SVG.tooltip({object:obj,index:idx,group:null,sequentialIndex:seq,text:prop.tooltips[seq],event:e});obj.highlight(e.target);},false);opt.rect.addEventListener('mousemove',function(e)
49
+ {e.target.style.cursor='pointer'},false);})(opt.index,opt.sequentialIndex);}};this.getWidth=function(value)
50
+ {var x1=this.getLeftXCoord(0),x2=this.getLeftXCoord(value);if(RG.SVG.isNull(x1)||RG.SVG.isNull(x2)){return null;}
51
+ return x1-x2;};this.getLeftXCoord=function(value)
52
+ {var width;if(value>this.scale.max){return null;}
53
+ if(value<this.scale.min){return null;}
54
+ width=((value-this.scale.min)/(this.scale.max-this.scale.min));width*=this.graphWidth;var x=prop.gutterLeft+this.graphWidth-width;return x;};this.getRightXCoord=function(value)
55
+ {var width;if(value>this.scale.max){return null;}
56
+ if(value<this.scale.min){return null;}
57
+ width=((value-this.scale.min)/(this.scale.max-this.scale.min));width*=this.graphWidth;var x=prop.gutterLeft+this.graphWidth+prop.gutterCenter+width;return x;};this.highlight=function(rect)
58
+ {var x=parseInt(rect.getAttribute('x')),y=parseInt(rect.getAttribute('y')),width=parseInt(rect.getAttribute('width')),height=parseInt(rect.getAttribute('height'));var highlight=RG.SVG.create({svg:this.svg,parent:this.svg.all,type:'rect',attr:{stroke:prop.highlightStroke,fill:prop.highlightFill,x:x-1,y:y-1,width:width+2,height:height+2},style:{pointerEvents:'none'}});RG.SVG.REG.set('highlight',highlight);};this.parseColors=function()
59
+ {if(!Object.keys(this.originalColors).length){this.originalColors={colors:RG.SVG.arrayClone(prop.colors),backgroundGridColor:RG.SVG.arrayClone(prop.backgroundGridColor),highlightFill:RG.SVG.arrayClone(prop.highlightFill),backgroundColor:RG.SVG.arrayClone(prop.backgroundColor)}}
60
+ var colors=prop.colors;if(colors){for(var i=0;i<colors.length;++i){colors[i]=RG.SVG.parseColorLinear({object:this,color:colors[i],direction:'horizontal'});}}
61
+ prop.backgroundGridColor=RG.SVG.parseColorLinear({object:this,color:prop.backgroundGridColor,direction:'horizontal'});prop.highlightFill=RG.SVG.parseColorLinear({object:this,color:prop.highlightFill,direction:'horizontal'});prop.backgroundColor=RG.SVG.parseColorLinear({object:this,color:prop.backgroundColor,direction:'horizontal'});};this.drawLabelsAbove=function()
62
+ {if(prop.labelsAbove){for(var dataset=0,seq=0;dataset<this.data.length;++dataset,++seq){for(var i=0;i<this.data[dataset].length;++i,++seq){var value=this.data[dataset][i],halign=dataset===0?'right':'left',valign='center',hoffset=dataset===0?-10:10;if(typeof value==='number'){var x=parseInt(this.coords[seq].element.getAttribute('x'))+hoffset+prop.labelsAboveOffsetx,height=parseInt(this.coords[seq].element.getAttribute('height')),y=parseInt(this.coords[seq].element.getAttribute('y'))+(height/2)+prop.labelsAboveOffsety,width=parseInt(this.coords[seq].element.getAttribute('width'));if(dataset===1){x+=width;}
63
+ var str=RG.SVG.numberFormat({object:this,num:value.toFixed(prop.labelsAboveDecimals),prepend:typeof prop.labelsAboveUnitsPre==='string'?prop.labelsAboveUnitsPre:null,append:typeof prop.labelsAboveUnitsPost==='string'?prop.labelsAboveUnitsPost:null,point:typeof prop.labelsAbovePoint==='string'?prop.labelsAbovePoint:null,thousand:typeof prop.labelsAboveThousand==='string'?prop.labelsAboveThousand:null,formatter:typeof prop.labelsAboveFormatter==='function'?prop.labelsAboveFormatter:null});if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&(typeof prop.labelsAboveSpecific[seq]==='string'||typeof prop.labelsAboveSpecific[seq]==='number')){str=parseStr(prop.labelsAboveSpecific[seq]);}else if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&typeof prop.labelsAboveSpecific[seq]!=='string'&&typeof prop.labelsAboveSpecific[seq]!=='number'){continue;}
64
+ RG.SVG.text({object:this,parent:this.svg.all,text:str,x:x,y:y,halign:halign,valign:valign,tag:'labels.above',font:prop.labelsAboveFont||prop.textFont,size:prop.labelsAboveSize||prop.textSize,bold:typeof prop.labelsAboveBold==='boolean'?prop.labelsAboveBold:prop.textBold,italic:typeof prop.labelsAboveItalic==='boolean'?prop.labelsAboveItalic:prop.textItalic,color:prop.labelsAboveColor||prop.textColor,background:prop.labelsAboveBackground,padding:prop.labelsAboveBackgroundPadding});}else if(typeof value==='object'&&prop.grouping==='stacked'){for(var k=0,sum=0,width=0;k<this.coords2[i].length;++k){sum+=parseFloat(this.coords2[i][k].element.getAttribute('data-value'));}
65
+ var len=this.coords2[i].length;if(dataset===0){var x=parseFloat(this.coords2[i][len-1].x)+hoffset,height=parseFloat(this.coords2[i][len-1].height),y=parseFloat(this.coords2[i][0].y)+(height/2);}else{var x=parseFloat(this.coords2[this.data[0].length+i][0].x)+hoffset+prop.labelsAboveOffsetx,height=parseFloat(this.coords2[i][len-1].height),y=parseFloat(this.coords2[i][0].y)+(height/2)+prop.labelsAboveOffsety;for(var j=0;j<this.coords2Right[i].length;++j){x+=this.coords2Right[i][j].width;}}
66
+ var str=RG.SVG.numberFormat({object:this,num:sum.toFixed(prop.labelsAboveDecimals),prepend:typeof prop.labelsAboveUnitsPre==='string'?prop.labelsAboveUnitsPre:null,append:typeof prop.labelsAboveUnitsPost==='string'?prop.labelsAboveUnitsPost:null,point:typeof prop.labelsAbovePoint==='string'?prop.labelsAbovePoint:null,thousand:typeof prop.labelsAboveThousand==='string'?prop.labelsAboveThousand:null,formatter:typeof prop.labelsAboveFormatter==='function'?prop.labelsAboveFormatter:null});if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&(typeof prop.labelsAboveSpecific[seq]==='string'||typeof prop.labelsAboveSpecific[seq]==='number')){str=parseStr(prop.labelsAboveSpecific[seq]);}else if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&typeof prop.labelsAboveSpecific[seq]!=='string'&&typeof prop.labelsAboveSpecific[seq]!=='number'){continue;}
67
+ RG.SVG.text({object:this,parent:this.svg.all,text:str,x:x,y:y,halign:halign,valign:valign,tag:'labels.above',font:prop.labelsAboveFont||prop.textFont,size:prop.labelsAboveSize||prop.textSize,bold:typeof prop.labelsAboveBold==='boolean'?prop.labelsAboveBold:prop.textBold,italic:typeof prop.labelsAboveItalic==='boolean'?prop.labelsAboveItalic:prop.textItalic,color:prop.labelsAboveColor||prop.textColor,background:prop.labelsAboveBackground,padding:prop.labelsAboveBackgroundPadding});}else if(typeof value==='object'&&prop.grouping==='grouped'){for(var k=0;k<value.length;++k){val=value[k];var x=parseInt(this.coords[seq].element.getAttribute('x'))+hoffset+prop.labelsAboveOffsetx,height=parseInt(this.coords[seq].element.getAttribute('height')),y=parseInt(this.coords[seq].element.getAttribute('y'))+(height/2)+prop.labelsAboveOffsety,width=parseInt(this.coords[seq].element.getAttribute('width'));if(dataset===1){x+=width;}
68
+ var str=RG.SVG.numberFormat({object:this,num:parseFloat(val).toFixed(prop.labelsAboveDecimals),prepend:typeof prop.labelsAboveUnitsPre==='string'?prop.labelsAboveUnitsPre:null,append:typeof prop.labelsAboveUnitsPost==='string'?prop.labelsAboveUnitsPost:null,point:typeof prop.labelsAbovePoint==='string'?prop.labelsAbovePoint:null,thousand:typeof prop.labelsAboveThousand==='string'?prop.labelsAboveThousand:null,formatter:typeof prop.labelsAboveFormatter==='function'?prop.labelsAboveFormatter:null});if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&(typeof prop.labelsAboveSpecific[seq]==='string'||typeof prop.labelsAboveSpecific[seq]==='number')){str=parseStr(prop.labelsAboveSpecific[seq]);}else if(prop.labelsAboveSpecific&&prop.labelsAboveSpecific.length&&typeof prop.labelsAboveSpecific[seq]!=='string'&&typeof prop.labelsAboveSpecific[seq]!=='number'){continue;}
69
+ RG.SVG.text({object:this,parent:this.svg.all,text:str,x:x,y:y,halign:halign,valign:valign,tag:'labels.above',font:prop.labelsAboveFont||prop.textFont,size:prop.labelsAboveSize||prop.textSize,bold:typeof prop.labelsAboveBold==='boolean'?prop.labelsAboveBold:prop.textBold,italic:typeof prop.labelsAboveItalic==='boolean'?prop.labelsAboveItalic:prop.textItalic,color:prop.labelsAboveColor||prop.textColor,background:prop.labelsAboveBackground,padding:prop.labelsAboveBackgroundPadding});seq++;}
70
+ seq--;}}
71
+ --seq;}}};this.on=function(type,func)
72
+ {if(type.substr(0,2)!=='on'){type='on'+type;}
73
+ RG.SVG.addCustomEventListener(this,type,func);return this;};this.exec=function(func)
74
+ {func(this);return this;};this.removeHighlight=function()
75
+ {var highlight=RG.SVG.REG.get('highlight');if(highlight&&highlight.parentNode){highlight.parentNode.removeChild(highlight);}
76
+ RG.SVG.REG.set('highlight',null);};this.getGutterCenter=function()
77
+ {var bold=typeof prop.yaxisTextBold==='boolean'?prop.yaxisTextBold:prop.textBold,font=typeof prop.yaxisTextFont==='string'?prop.yaxisTextFont:prop.textFont,size=typeof prop.yaxisTextSize==='number'?prop.yaxisTextSize:prop.textSize,width=0;if(prop.yaxisLabels){for(var i=0,len=prop.yaxisLabels.length;i<len;++i){width=ma.max(width,RG.SVG.measureText({text:prop.yaxisLabels[i],bold:bold,font:font,size:size})[0]);}}else{var width=50;}
78
+ return width+15;};this.drawTitle=function()
79
+ {if(RG.SVG.isNull(prop.titleX)){prop.titleX=((this.width-prop.gutterLeft-prop.gutterRight)/2)+prop.gutterLeft;}
80
+ RG.SVG.drawTitle(this);};this.grow=function()
81
+ {var opt=arguments[0]||{},frames=opt.frames||30,frame=0,obj=this,left=RG.SVG.arrayClone(this.left),right=RG.SVG.arrayClone(this.right),seq=0;this.draw();var iterate=function()
82
+ {for(var i=0,seq=0,len=obj.coordsLeft.length;i<len;++i,++seq){var multiplier=(frame/frames)*RG.SVG.FX.getEasingMultiplier(frames,frame)*RG.SVG.FX.getEasingMultiplier(frames,frame);if(typeof left[i]==='number'){width=ma.abs(obj.getLeftXCoord(left[i])-obj.getLeftXCoord(0));left[i]=obj.left[i]*multiplier;obj.coordsLeft[i].element.setAttribute('width',width);obj.coords[seq].element.setAttribute('x',obj.getLeftXCoord(0)-width);}else if(typeof left[i]==='object'&&prop.grouping==='stacked'){var accumulativeWidth=0;for(var j=0,len2=left[i].length;j<len2;++j,++seq){width=ma.abs(obj.getLeftXCoord(left[i][j])-obj.getLeftXCoord(0));left[i][j]=obj.left[i][j]*multiplier;obj.coords[seq].element.setAttribute('width',width);obj.coords[seq].element.setAttribute('x',obj.getLeftXCoord(0)-width-accumulativeWidth);accumulativeWidth+=(prop.grouping==='stacked'?width:0);}
83
+ if(obj.stackedBackfacesLeft[i]){obj.stackedBackfacesLeft[i].setAttribute('width',accumulativeWidth);obj.stackedBackfacesLeft[i].setAttribute('x',obj.getLeftXCoord(0)-accumulativeWidth);}
84
+ --seq;}else if(typeof left[i]==='object'&&prop.grouping==='grouped'){for(var j=0,len2=left[i].length;j<len2;++j,++seq){width=ma.abs(obj.getLeftXCoord(left[i][j])-obj.getLeftXCoord(0));left[i][j]=obj.left[i][j]*multiplier;obj.coords[seq].element.setAttribute('width',width);obj.coords[seq].element.setAttribute('x',obj.getLeftXCoord(0)-width);}
85
+ --seq;}}
86
+ for(var i=0,seq=0,len=obj.coordsRight.length;i<len;++i,++seq){var multiplier=(frame/frames)*RG.SVG.FX.getEasingMultiplier(frames,frame)*RG.SVG.FX.getEasingMultiplier(frames,frame);if(typeof right[i]==='number'){width=ma.abs(obj.getRightXCoord(right[i])-obj.getRightXCoord(0));right[i]=obj.right[i]*multiplier;obj.coordsRight[i].element.setAttribute('width',width);obj.coordsRight[seq].element.setAttribute('x',obj.getRightXCoord(0));}else if(typeof right[i]==='object'&&prop.grouping==='stacked'){var accumulativeWidth=0;for(var j=0,len2=right[i].length;j<len2;++j,++seq){width=ma.abs(obj.getRightXCoord(right[i][j])-obj.getRightXCoord(0));right[i][j]=obj.right[i][j]*multiplier;obj.coordsRight[seq].element.setAttribute('width',width);obj.coordsRight[seq].element.setAttribute('x',obj.getRightXCoord(0)+accumulativeWidth);accumulativeWidth+=width;}
87
+ if(obj.stackedBackfacesRight[i]){obj.stackedBackfacesRight[i].setAttribute('width',accumulativeWidth);obj.stackedBackfacesRight[i].setAttribute('x',obj.getRightXCoord(0));}
88
+ --seq;}else if(typeof right[i]==='object'&&prop.grouping==='grouped'){for(var j=0,len2=right[i].length;j<len2;++j,++seq){width=ma.abs(obj.getRightXCoord(right[i][j])-obj.getRightXCoord(0));right[i][j]=obj.right[i][j]*multiplier;obj.coordsRight[seq].element.setAttribute('width',width);obj.coordsRight[seq].element.setAttribute('x',obj.getRightXCoord(0));}
89
+ --seq;}}
90
+ if(frame++<=frames){RG.SVG.FX.update(iterate);}else if(opt.callback){(opt.callback)(obj);}};iterate();return this;};this.wave=function()
91
+ {var obj=this,opt=arguments[0]||{},frames=opt.frames||120,startFrames_left=[],startFrames_right=[],counters_left=[],counters_right=[];var framesperbar=frames/3,frame_left=-1,frame_right=-1,callback=arguments[1]||function(){},original_left=RG.SVG.arrayClone(this.left),original_right=RG.SVG.arrayClone(this.right);for(var i=0,len=this.left.length,seq=0;i<len;i+=1,++seq){startFrames_left[seq]=((frames/3)/(RG.SVG.arrayLinearize(this.left).length-1))*i;startFrames_right[seq]=((frames/3)/(RG.SVG.arrayLinearize(this.right).length-1))*i;counters_left[seq]=0;counters_right[seq]=0;if(RG.SVG.isArray(this.left[i])){for(var j=0;j<this.left[i].length;++j,seq++){startFrames_left[seq]=((frames/3)/(RG.SVG.arrayLinearize(this.left).length-1))*seq;startFrames_right[seq]=((frames/3)/(RG.SVG.arrayLinearize(this.right).length-1))*seq;counters_left[seq]=0;counters_right[seq]=0;}
92
+ --seq;}}
93
+ this.draw();for(var i=0,len=this.left.length;i<len;i+=1){if(typeof this.left[i]==='number'){this.left[i]=0;this.right[i]=0;this.coordsLeft[i].element.setAttribute('width',0);this.coordsRight[i].element.setAttribute('width',0);}else if(typeof this.left[i]==='object'&&!RG.SVG.isNull(this.left[i])){for(var j=0;j<this.left[i].length;++j){this.left[i][j]=0;this.right[i][j]=0;this.coords2Left[i][j].element.setAttribute('width',0);this.coords2Right[i][j].element.setAttribute('width',0);}}}
94
+ function iteratorLeft()
95
+ {++frame_left;for(var i=0,len=obj.left.length,seq=0;i<len;i+=1,seq+=1){if(frame_left>=startFrames_left[seq]){var isNull=RG.SVG.isNull(obj.left[i]);if(typeof obj.left[i]==='number'){obj.left[i]=ma.min(ma.abs(original_left[i]),ma.abs(original_left[i]*((counters_left[i]++)/framesperbar)));var rect_left=obj.coords[i].element;rect_left.setAttribute('width',parseFloat(rect_left.getAttribute('data-original-width'))*(obj.left[i]/rect_left.getAttribute('data-value')));rect_left.setAttribute('x',obj.properties.gutterLeft+obj.graphWidth-(parseFloat(rect_left.getAttribute('data-original-width'))*(obj.left[i]/rect_left.getAttribute('data-value'))));}else if(RG.SVG.isArray(obj.left[i])){for(var j=0,accWidth=0;j<obj.left[i].length;++j,++seq){obj.left[i][j]=ma.min(ma.abs(original_left[i][j]),ma.abs(original_left[i][j]*((counters_left[seq]++)/framesperbar)));var rect_left=obj.coords[seq].element;rect_left.setAttribute('width',parseFloat(rect_left.getAttribute('data-original-width'))*(obj.left[i][j]/rect_left.getAttribute('data-value')));rect_left.setAttribute('x',obj.properties.gutterLeft+obj.graphWidth-(parseFloat(rect_left.getAttribute('data-original-width'))*(obj.left[i][j]/rect_left.getAttribute('data-value')))-accWidth);if(obj.properties.grouping==='stacked'){accWidth+=parseFloat(rect_left.getAttribute('width'));}}
96
+ seq--;}
97
+ if(isNull){obj.left[i]=null;}}else{obj.left[i]=typeof obj.left[i]==='object'&&obj.left[i]?RG.SVG.arrayPad([],obj.left[i].length,0):(RG.SVG.isNull(obj.left[i])?null:0);}}
98
+ if(frame_left<=frames){RG.SVG.FX.update(iteratorLeft);}}
99
+ function iteratorRight()
100
+ {++frame_right;for(var i=0,len=obj.right.length,seq=0;i<len;i+=1,seq+=1){if(frame_right>=startFrames_right[seq]){var isNull=RG.SVG.isNull(obj.right[i]);if(typeof obj.right[i]==='number'){obj.right[i]=ma.min(ma.abs(original_right[i]),ma.abs(original_right[i]*((counters_right[i]++)/framesperbar)));var rect_right=obj.coords[i+obj.left.length].element;rect_right.setAttribute('width',parseFloat(rect_right.getAttribute('data-original-width'))*(obj.right[i]/rect_right.getAttribute('data-value')));rect_right.setAttribute('x',obj.properties.gutterLeft+obj.graphWidth+prop.gutterCenter);}else if(RG.SVG.isArray(obj.right[i])){for(var j=0,accWidth=0;j<obj.right[i].length;++j,++seq){obj.right[i][j]=ma.min(ma.abs(original_right[i][j]),ma.abs(original_right[i][j]*((counters_right[seq]++)/framesperbar)));var rect_right=obj.coordsRight[seq].element;rect_right.setAttribute('width',parseFloat(rect_right.getAttribute('data-original-width'))*(obj.right[i][j]/rect_right.getAttribute('data-value')));rect_right.setAttribute('x',obj.properties.gutterLeft+obj.graphWidth+prop.gutterCenter+accWidth);if(obj.properties.grouping==='stacked'){accWidth+=parseFloat(rect_right.getAttribute('width'));}}
101
+ seq--;}
102
+ if(isNull){obj.right[i]=null;}}else{obj.right[i]=typeof obj.right[i]==='object'&&obj.right[i]?RG.SVG.arrayPad([],obj.right[i].length,0):(RG.SVG.isNull(obj.right[i])?null:0);}}
103
+ if(frame_right<=frames){RG.SVG.FX.update(iteratorRight);}else{}}
104
+ iteratorLeft();iteratorRight();return this;};for(i in conf.options){if(typeof i==='string'){this.set(i,conf.options[i]);}}};return this;})(window,document);
@@ -2,7 +2,8 @@
2
2
  RGraph=window.RGraph||{isRGraph:true,isRGraphSVG:true};RGraph.SVG=RGraph.SVG||{};RGraph.SVG.FX=RGraph.SVG.FX||{};(function(win,doc,undefined)
3
3
  {var RG=RGraph,ua=navigator.userAgent,ma=Math;RG.SVG.REG={store:[]};RG.SVG.OR={objects:[]};RG.SVG.TRIG={};RG.SVG.TRIG.HALFPI=ma.PI*.4999;RG.SVG.TRIG.PI=RG.SVG.TRIG.HALFPI*2;RG.SVG.TRIG.TWOPI=RG.SVG.TRIG.PI*2;RG.SVG.ISIE=ua.indexOf('rident')>0;RG.SVG.ISFF=ua.indexOf('irefox')>0;RG.SVG.events=[];RG.SVG.GLOBALS={};RG.SVG.ISFF=ua.indexOf('Firefox')!=-1;RG.SVG.ISOPERA=ua.indexOf('Opera')!=-1;RG.SVG.ISCHROME=ua.indexOf('Chrome')!=-1;RG.SVG.ISSAFARI=ua.indexOf('Safari')!=-1&&!RG.ISCHROME;RG.SVG.ISWEBKIT=ua.indexOf('WebKit')!=-1;RG.SVG.ISIE=ua.indexOf('Trident')>0||navigator.userAgent.indexOf('MSIE')>0;RG.SVG.ISIE6=ua.indexOf('MSIE 6')>0;RG.SVG.ISIE7=ua.indexOf('MSIE 7')>0;RG.SVG.ISIE8=ua.indexOf('MSIE 8')>0;RG.SVG.ISIE9=ua.indexOf('MSIE 9')>0;RG.SVG.ISIE10=ua.indexOf('MSIE 10')>0;RG.SVG.ISIE11UP=ua.indexOf('MSIE')==-1&&ua.indexOf('Trident')>0;RG.SVG.ISIE10UP=RG.SVG.ISIE10||RG.SVG.ISIE11UP;RG.SVG.ISIE9UP=RG.SVG.ISIE9||RG.SVG.ISIE10UP;RG.SVG.createSVG=function(opt)
4
4
  {var container=opt.container,obj=opt.object;if(container.__svg__){return container.__svg__;}
5
- var svg=doc.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute('style','top: 0; left: 0; position: absolute');svg.setAttribute('width',container.offsetWidth);svg.setAttribute('height',container.offsetHeight);svg.setAttribute('version','1.1');svg.setAttributeNS("http://www.w3.org/2000/xmlns/",'xmlns','http://www.w3.org/2000/svg');svg.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");container.appendChild(svg);container.__svg__=svg;container.style.position='relative';var numLayers=10;for(var i=1;i<=numLayers;++i){var group=RG.SVG.create({svg:svg,type:'g',attr:{className:'background'+i}});obj.layers['background'+i]=group;svg['background'+i]=group;}
5
+ var svg=doc.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute('style','top: 0; left: 0; position: absolute');svg.setAttribute('width',container.offsetWidth);svg.setAttribute('height',container.offsetHeight);svg.setAttribute('version','1.1');svg.setAttributeNS("http://www.w3.org/2000/xmlns/",'xmlns','http://www.w3.org/2000/svg');svg.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");svg.__object__=obj;svg.__container__=container;container.appendChild(svg);container.__svg__=svg;container.__object__=obj;var style=getComputedStyle(container);if(style.position!=='absolute'&&style.position!=='fixed'&&style.position!=='sticky'){container.style.position='relative';}
6
+ var numLayers=10;for(var i=1;i<=numLayers;++i){var group=RG.SVG.create({svg:svg,type:'g',attr:{className:'background'+i}});obj.layers['background'+i]=group;svg['background'+i]=group;}
6
7
  var group=RG.SVG.create({svg:svg,type:'g',attr:{className:'all-elements'}});container.__svg__.all=group;return svg;};RG.SVG.createDefs=function(obj)
7
8
  {if(!obj.svg.defs){var defs=RG.SVG.create({svg:obj.svg,type:'defs'});obj.svg.defs=defs;}
8
9
  return defs;};RG.SVG.create=function(opt)
@@ -23,11 +24,13 @@ if(typeof prop.xaxisLabelsPositionSectionTickmarksCount==='number'){dataPoints=p
23
24
  for(var i=0;i<dataPoints;++i){x=prop.gutterLeft+((i+1)*(obj.graphWidth/dataPoints));RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x+0.001,startY,x,endY),stroke:prop.xaxisColor,'stroke-width':typeof prop.xaxisLinewidth==='number'?prop.xaxisLinewidth:1,'shape-rendering':"crispEdges"}});}}else if(prop.xaxisLabelsPosition==='edge'){if(typeof prop.xaxisLabelsPositionEdgeTickmarksCount==='number'){var len=prop.xaxisLabelsPositionEdgeTickmarksCount;}else{var len=obj.data&&obj.data[0]&&obj.data[0].length?obj.data[0].length:0;}
24
25
  for(var i=0;i<len;++i){var gap=((obj.graphWidth)/(len-1)),x=prop.gutterLeft+((i+1)*gap);RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x+0.001,startY,x,endY),stroke:prop.xaxisColor,'stroke-width':typeof prop.xaxisLinewidth==='number'?prop.xaxisLinewidth:1,'shape-rendering':"crispEdges"}});}}}
25
26
  if(prop.yaxis===false){RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(prop.gutterLeft+0.001,startY,prop.gutterLeft,endY),stroke:obj.properties.xaxisColor,'stroke-width':typeof prop.xaxisLinewidth==='number'?prop.xaxisLinewidth:1,'shape-rendering':"crispEdges",parent:obj.svg.all,}});}}}
26
- if(prop.xaxisScale){var segment=obj.graphWidth/prop.xaxisLabelsCount;for(var i=0;i<obj.scale.labels.length;++i){var x=prop.gutterLeft+(segment*i)+segment+prop.xaxisLabelsOffsetx;RG.SVG.text({object:obj,parent:obj.svg.all,text:obj.scale.labels[i],x:x,y:(obj.height-prop.gutterBottom)+(prop.xaxis?prop.xaxisTickmarksLength+6:10)+(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety,halign:'center',valign:'top',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.xaxisTextBold||prop.textBold,italic:prop.xaxisTextItalic||prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}
27
- if(prop.xaxisLabelsCount>0){var y=obj.height-prop.gutterBottom+prop.xaxisLabelsOffsety+(prop.xaxis?prop.xaxisTickmarksLength+6:10),str=RG.SVG.numberFormat({object:obj,num:prop.xaxisMin.toFixed(prop.xaxisDecimals),prepend:prop.xaxisUnitsPre,append:prop.xaxisUnitsPost,point:prop.xaxisPoint,thousand:prop.xaxisThousand,formatter:prop.xaxisFormatter});var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:typeof prop.xaxisFormatter==='function'?(prop.xaxisFormatter)(this,prop.xaxisMin):str,x:prop.gutterLeft+prop.xaxisLabelsOffsetx,y:y,halign:'center',valign:'top',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.xaxisTextBold||prop.textBold,italic:prop.xaxisTextItalic||prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}}else{if(typeof prop.xaxisLabels==='object'&&!RG.SVG.isNull(prop.xaxisLabels)){if(prop.xaxisLabelsPosition==='section'){var segment=(obj.width-prop.gutterLeft-prop.gutterRight)/prop.xaxisLabels.length;for(var i=0;i<prop.xaxisLabels.length;++i){var x=prop.gutterLeft+(segment/2)+(i*segment);if(obj.scale.max<=0&&obj.scale.min<obj.scale.max){var y=prop.gutterTop-(RG.SVG.ISFF?5:10)-(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;var valign='bottom';}else{var y=obj.height-prop.gutterBottom+(RG.SVG.ISFF?5:10)+(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;var valign='top';}
28
- RG.SVG.text({object:obj,parent:obj.svg.all,text:prop.xaxisLabels[i],x:x+prop.xaxisLabelsOffsetx,y:y,valign:valign,halign:'center',size:prop.xaxisTextSize||prop.textSize,italic:prop.xaxisTextItalic||prop.textItalic,font:prop.xaxisTextFont||prop.textFont,bold:prop.xaxisTextBold||prop.textBold,color:prop.xaxisTextColor||prop.textColor});}}else if(prop.xaxisLabelsPosition==='edge'){if(obj.type==='line'){var hmargin=prop.hmargin;}else{var hmargin=0;}
27
+ if(prop.xaxisScale){if(obj.type==='scatter'){obj.xscale=RG.SVG.getScale({object:obj,numlabels:prop.xaxisLabelsCount,unitsPre:prop.xaxisUnitsPre,unitsPost:prop.xaxisUnitsPost,max:prop.xaxisMax,min:prop.xaxisMin,point:prop.xaxisPoint,round:prop.xaxisRound,thousand:prop.xaxisThousand,decimals:prop.xaxisDecimals,strict:typeof prop.xaxisMax==='number',formatter:prop.xaxisFormatter});var segment=obj.graphWidth/prop.xaxisLabelsCount
28
+ for(var i=0;i<obj.xscale.labels.length;++i){var x=prop.gutterLeft+(segment*i)+segment+prop.xaxisLabelsOffsetx;var y=(obj.height-prop.gutterBottom)+(prop.xaxis?prop.xaxisTickmarksLength+6:10)+(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;RG.SVG.text({object:obj,parent:obj.svg.all,text:obj.xscale.labels[i],x:x,y:y,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.xaxisTextBold||prop.textBold,italic:prop.xaxisTextItalic||prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}
29
+ if(prop.xaxisLabelsCount>0){var y=obj.height-prop.gutterBottom+prop.xaxisLabelsOffsety+(prop.xaxis?prop.xaxisTickmarksLength+6:10),str=RG.SVG.numberFormat({object:obj,num:prop.xaxisMin.toFixed(prop.xaxisDecimals),prepend:prop.xaxisUnitsPre,append:prop.xaxisUnitsPost,point:prop.xaxisPoint,thousand:prop.xaxisThousand,formatter:prop.xaxisFormatter});var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:typeof prop.xaxisFormatter==='function'?(prop.xaxisFormatter)(this,prop.xaxisMin):str,x:prop.gutterLeft+prop.xaxisLabelsOffsetx,y:y,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.xaxisTextBold||prop.textBold,italic:prop.xaxisTextItalic||prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}}else{var segment=obj.graphWidth/prop.xaxisLabelsCount,scale=obj.scale;for(var i=0;i<scale.labels.length;++i){var x=prop.gutterLeft+(segment*i)+segment+prop.xaxisLabelsOffsetx;var y=(obj.height-prop.gutterBottom)+(prop.xaxis?prop.xaxisTickmarksLength+6:10)+(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;RG.SVG.text({object:obj,parent:obj.svg.all,text:obj.scale.labels[i],x:x,y:y,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.xaxisTextBold||prop.textBold,italic:prop.xaxisTextItalic||prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}
30
+ if(prop.xaxisLabelsCount>0){var y=obj.height-prop.gutterBottom+prop.xaxisLabelsOffsety+(prop.xaxis?prop.xaxisTickmarksLength+6:10),str=RG.SVG.numberFormat({object:obj,num:prop.xaxisMin.toFixed(prop.xaxisDecimals),prepend:prop.xaxisUnitsPre,append:prop.xaxisUnitsPost,point:prop.xaxisPoint,thousand:prop.xaxisThousand,formatter:prop.xaxisFormatter});var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:typeof prop.xaxisFormatter==='function'?(prop.xaxisFormatter)(this,prop.xaxisMin):str,x:prop.gutterLeft+prop.xaxisLabelsOffsetx,y:y,halign:'center',valign:'top',tag:'labels.xaxis',font:prop.xaxisTextFont||prop.textFont,size:prop.xaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.xaxisTextBold||prop.textBold,italic:prop.xaxisTextItalic||prop.textItalic,color:prop.xaxisTextColor||prop.textColor});}}}else{if(typeof prop.xaxisLabels==='object'&&!RG.SVG.isNull(prop.xaxisLabels)){var angle=prop.xaxisTextAngle;if(prop.xaxisLabelsPosition==='section'){var segment=(obj.width-prop.gutterLeft-prop.gutterRight)/prop.xaxisLabels.length;for(var i=0;i<prop.xaxisLabels.length;++i){var x=prop.gutterLeft+(segment/2)+(i*segment);if(obj.scale.max<=0&&obj.scale.min<obj.scale.max){var y=prop.gutterTop-(RG.SVG.ISFF?5:10)-(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;var valign='bottom';}else{var y=obj.height-prop.gutterBottom+(RG.SVG.ISFF?5:10)+(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;var valign='top';}
31
+ RG.SVG.text({object:obj,parent:obj.svg.all,text:prop.xaxisLabels[i],x:x+prop.xaxisLabelsOffsetx,y:y,valign:(typeof angle==='number'&&angle)?'center':valign,halign:(typeof angle==='number'&&angle)?'right':'center',angle:angle,tag:'labels.xaxis',size:prop.xaxisTextSize||prop.textSize,italic:prop.xaxisTextItalic||prop.textItalic,font:prop.xaxisTextFont||prop.textFont,bold:prop.xaxisTextBold||prop.textBold,color:prop.xaxisTextColor||prop.textColor});}}else if(prop.xaxisLabelsPosition==='edge'){if(obj.type==='line'){var hmargin=prop.hmargin;}else{var hmargin=0;}
29
32
  var segment=(obj.graphWidth-hmargin-hmargin)/(prop.xaxisLabels.length-1);for(var i=0;i<prop.xaxisLabels.length;++i){var x=prop.gutterLeft+(i*segment)+hmargin;if(obj.scale.max<=0&&obj.scale.min<0){valign='bottom';y=prop.gutterTop-(RG.SVG.ISFF?5:10)-(prop.xaxisTickmarksLength-5)-(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety}else{valign='top';y=obj.height-prop.gutterBottom+(RG.SVG.ISFF?5:10)+(prop.xaxisTickmarksLength-5)+(prop.xaxisLinewidth||1)+prop.xaxisLabelsOffsety;}
30
- RG.SVG.text({object:obj,parent:obj.svg.all,text:prop.xaxisLabels[i],x:x+prop.xaxisLabelsOffsetx,y:y,valign:valign,halign:'center',size:prop.xaxisTextSize||prop.textSize,italic:prop.xaxisTextItalic||prop.textItalic,font:prop.xaxisTextFont||prop.textFont,bold:prop.xaxisTextBold||prop.textBold,color:prop.xaxisTextColor||prop.textColor});}}}}};RG.SVG.drawYAxis=function(obj)
33
+ RG.SVG.text({object:obj,parent:obj.svg.all,text:prop.xaxisLabels[i],x:x+prop.xaxisLabelsOffsetx,y:y,valign:(typeof angle==='number'&&angle)?'center':valign,halign:(typeof angle==='number'&&angle)?'right':'center',angle:angle,tag:'labels.xaxis',size:prop.xaxisTextSize||prop.textSize,italic:prop.xaxisTextItalic||prop.textItalic,font:prop.xaxisTextFont||prop.textFont,bold:prop.xaxisTextBold||prop.textBold,color:prop.xaxisTextColor||prop.textColor});}}}}};RG.SVG.drawYAxis=function(obj)
31
34
  {var prop=obj.properties;if(prop.yaxis){if(obj.type==='hbar'){var x=obj.getXCoord(prop.xaxisMin>0?prop.xaxisMin:0);if(prop.xaxisMin<0&&prop.xaxisMax<=0){x=obj.getXCoord(prop.xaxisMax);}}else{var x=prop.gutterLeft;}
32
35
  var axis=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(x,prop.gutterTop,x,obj.height-prop.gutterBottom),stroke:prop.yaxisColor,fill:prop.yaxisColor,'stroke-width':typeof prop.yaxisLinewidth==='number'?prop.yaxisLinewidth:1,'shape-rendering':"crispEdges",'stroke-linecap':'square'}});if(obj.type==='hbar'){var height=(obj.graphHeight-prop.vmarginTop-prop.vmarginBottom)/prop.yaxisLabels.length,y=prop.gutterTop+prop.vmarginTop,len=prop.yaxisLabels.length,startX=obj.getXCoord(0)+(prop.xaxisMin<0?prop.yaxisTickmarksLength:0),endX=obj.getXCoord(0)-prop.yaxisTickmarksLength;if(prop.xaxisMin<0&&prop.xaxisMax<=0){startX=obj.getXCoord(prop.xaxisMax);endX=obj.getXCoord(prop.xaxisMax)+5;}
33
36
  if(typeof prop.yaxisLabelsPositionSectionTickmarksCount==='number'){len=prop.yaxisLabelsPositionSectionTickmarksCount;height=(obj.graphHeight-prop.vmarginTop-prop.vmarginBottom)/len;}
@@ -36,25 +39,27 @@ if(prop.xaxis===false){if(obj.type==='hbar'&&prop.xaxisMin<=0&&prop.xaxisMax<0){
36
39
  var axis=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(startX,ma.round(obj.height-prop.gutterBottom-parseFloat(prop.vmarginBottom)),endX,ma.round(obj.height-prop.gutterBottom-parseFloat(prop.vmarginBottom))),stroke:obj.properties.yaxisColor,'stroke-width':typeof prop.yaxisLinewidth==='number'?prop.yaxisLinewidth:1,'shape-rendering':"crispEdges"}});}}}else{var height=obj.graphHeight/prop.yaxisLabelsCount,y=prop.gutterTop,len=prop.yaxisLabelsCount,startX=prop.gutterLeft,endX=prop.gutterLeft-prop.yaxisTickmarksLength;if(typeof prop.yaxisLabelsPositionEdgeTickmarksCount==='number'){len=prop.yaxisLabelsPositionEdgeTickmarksCount;height=obj.graphHeight/len;}
37
40
  if(prop.yaxisTickmarks){for(var i=0;i<len;++i){var axis=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(startX,y,endX,y),stroke:prop.yaxisColor,'stroke-width':typeof prop.yaxisLinewidth==='number'?prop.yaxisLinewidth:1,'shape-rendering':"crispEdges"}});y+=height;}
38
41
  if((prop.yaxisMin!==0||prop.xaxis===false)&&!(obj.scale.min>0&&obj.scale.max>0)){var axis=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:'M{1} {2} L{3} {4}'.format(prop.gutterLeft-prop.yaxisTickmarksLength,obj.height-prop.gutterBottom,prop.gutterLeft,obj.height-prop.gutterBottom-0.001),stroke:prop.yaxisColor,'stroke-width':typeof prop.yaxisLinewidth==='number'?prop.yaxisLinewidth:1,'shape-rendering':"crispEdges"}});}}}}
39
- if(prop.yaxisScale){var segment=(obj.height-prop.gutterTop-prop.gutterBottom)/prop.yaxisLabelsCount;for(var i=0;i<obj.scale.labels.length;++i){var y=obj.height-prop.gutterBottom-(segment*i)-segment;RG.SVG.text({object:obj,parent:obj.svg.all,text:obj.scale.labels[i],x:prop.gutterLeft-7-(prop.yaxis?(prop.yaxisTickmarksLength-3):0)+prop.yaxisLabelsOffsetx,y:y+prop.yaxisLabelsOffsety,halign:'right',valign:'center',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.yaxisTextBold||prop.textBold,italic:prop.yaxisTextItalic||prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}
40
- var y=obj.height-prop.gutterBottom,str=(prop.yaxisUnitsPre+prop.yaxisMin.toFixed(prop.yaxisDecimals).replace(/\./,prop.yaxisPoint)+prop.yaxisUnitsPost);var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:typeof prop.yaxisFormatter==='function'?(prop.yaxisFormatter)(this,prop.yaxisMin):str,x:prop.gutterLeft-7-(prop.yaxis?(prop.yaxisTickmarksLength-3):0)+prop.yaxisLabelsOffsetx,y:y+prop.yaxisLabelsOffsety,halign:'right',valign:'center',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.yaxisTextBold||prop.textBold,italic:prop.yaxisTextItalic||prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}else if(prop.yaxisLabels&&prop.yaxisLabels.length){for(var i=0;i<prop.yaxisLabels.length;++i){var segment=(obj.graphHeight-(prop.vmarginTop||0)-(prop.vmarginBottom||0))/prop.yaxisLabels.length,y=prop.gutterTop+(prop.vmarginTop||0)+(segment*i)+(segment/2)+prop.yaxisLabelsOffsety,x=prop.gutterLeft-7-(prop.yaxisLinewidth||1)+prop.yaxisLabelsOffsetx,halign='right';if(obj.type==='hbar'&&obj.scale.min<obj.scale.max&&obj.scale.max<=0){halign='left';x=obj.width-prop.gutterRight+7+prop.yaxisLabelsOffsetx;}else if(obj.type==='hbar'&&!prop.yaxisLabelsSpecific){var segment=(obj.graphHeight-(prop.vmarginTop||0)-(prop.vmarginBottom||0))/(prop.yaxisLabels.length);y=prop.gutterTop+(prop.vmarginTop||0)+(segment*i)+(segment/2)+prop.yaxisLabelsOffsetx;}else{var segment=(obj.graphHeight-(prop.vmarginTop||0)-(prop.vmarginBottom||0))/(prop.yaxisLabels.length-1);y=obj.height-prop.gutterBottom-(segment*i)+prop.yaxisLabelsOffsetx;}
41
- var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:prop.yaxisLabels[i]?prop.yaxisLabels[i]:'',x:x,y:y,halign:halign,valign:'center',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.yaxisTextBold||prop.textBold,italic:prop.yaxisTextItalic||prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}}};RG.SVG.drawBackground=function(obj)
42
+ if(prop.yaxisScale){var segment=(obj.height-prop.gutterTop-prop.gutterBottom)/prop.yaxisLabelsCount;for(var i=0;i<obj.scale.labels.length;++i){var y=obj.height-prop.gutterBottom-(segment*i)-segment;RG.SVG.text({object:obj,parent:obj.svg.all,text:obj.scale.labels[i],x:prop.gutterLeft-7-(prop.yaxis?(prop.yaxisTickmarksLength-3):0)+prop.yaxisLabelsOffsetx,y:y+prop.yaxisLabelsOffsety,halign:prop.yaxisLabelsHalign||'right',valign:prop.yaxisLabelsValign||'center',tag:'labels.yaxis',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.yaxisTextBold||prop.textBold,italic:prop.yaxisTextItalic||prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}
43
+ var y=obj.height-prop.gutterBottom,str=(prop.yaxisUnitsPre+prop.yaxisMin.toFixed(prop.yaxisDecimals).replace(/\./,prop.yaxisPoint)+prop.yaxisUnitsPost);var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:typeof prop.yaxisFormatter==='function'?(prop.yaxisFormatter)(this,prop.yaxisMin):str,x:prop.gutterLeft-7-(prop.yaxis?(prop.yaxisTickmarksLength-3):0)+prop.yaxisLabelsOffsetx,y:y+prop.yaxisLabelsOffsety,halign:'right',valign:'center',tag:'labels.yaxis',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:prop.yaxisTextBold||prop.textBold,italic:prop.yaxisTextItalic||prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}else if(prop.yaxisLabels&&prop.yaxisLabels.length){for(var i=0;i<prop.yaxisLabels.length;++i){var segment=(obj.graphHeight-(prop.vmarginTop||0)-(prop.vmarginBottom||0))/prop.yaxisLabels.length,y=prop.gutterTop+(prop.vmarginTop||0)+(segment*i)+(segment/2)+prop.yaxisLabelsOffsety,x=prop.gutterLeft-7-(prop.yaxisLinewidth||1)+prop.yaxisLabelsOffsetx,halign='right';if(obj.type==='hbar'&&obj.scale.min<obj.scale.max&&obj.scale.max<=0){halign='left';x=obj.width-prop.gutterRight+7+prop.yaxisLabelsOffsetx;}else if(obj.type==='hbar'&&!prop.yaxisLabelsSpecific){var segment=(obj.graphHeight-(prop.vmarginTop||0)-(prop.vmarginBottom||0))/(prop.yaxisLabels.length);y=prop.gutterTop+(prop.vmarginTop||0)+(segment*i)+(segment/2)+prop.yaxisLabelsOffsety;}else{var segment=(obj.graphHeight-(prop.vmarginTop||0)-(prop.vmarginBottom||0))/(prop.yaxisLabels.length-1);y=obj.height-prop.gutterBottom-(segment*i)+prop.yaxisLabelsOffsety;}
44
+ var text=RG.SVG.text({object:obj,parent:obj.svg.all,text:prop.yaxisLabels[i]?prop.yaxisLabels[i]:'',x:x,y:y,halign:halign,valign:'center',tag:'labels.yaxis',font:prop.yaxisTextFont||prop.textFont,size:prop.yaxisTextSize||(typeof prop.textSize==='number'?prop.textSize+'pt':prop.textSize),bold:typeof prop.yaxisTextBold==='boolean'?prop.yaxisTextBold:prop.textBold,italic:typeof prop.yaxisTextItalic==='boolean'?prop.yaxisTextItalic:prop.textItalic,color:prop.yaxisTextColor||prop.textColor});}}};RG.SVG.drawBackground=function(obj)
42
45
  {var prop=obj.properties;if(typeof prop.variant3dOffsetx!=='number')prop.variant3dOffsetx=0;if(typeof prop.variant3dOffsety!=='number')prop.variant3dOffsety=0;if(prop.backgroundColor){RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'rect',attr:{x:-1+prop.variant3dOffsetx+prop.gutterLeft,y:-1-prop.variant3dOffsety+prop.gutterTop,width:parseFloat(obj.svg.getAttribute('width'))+2-prop.gutterLeft-prop.gutterRight,height:parseFloat(obj.svg.getAttribute('height'))+2-prop.gutterTop-prop.gutterBottom,fill:prop.backgroundColor}});}
43
- if(prop.backgroundImage){var attr={'xlink:href':prop.backgroundImage,preserveAspectRatio:prop.backgroundImageAspect||'none',x:prop.gutterLeft,y:prop.gutterTop};if(prop.backgroundImageStretch){attr.x=prop.gutterLeft+prop.variant3dOffsetx;attr.y=prop.gutterTop+prop.variant3dOffsety;attr.width=obj.width-prop.gutterLeft-prop.gutterRight;attr.height=obj.height-prop.gutterTop-prop.gutterBottom;}else{if(typeof prop.backgroundImageX==='number'){attr.x=prop.backgroundImageX+prop.variant3dOffsetx;}
44
- if(typeof prop.backgroundImageY==='number'){attr.y=prop.backgroundImageY+prop.variant3dOffsety;}
46
+ if(prop.backgroundImage){var attr={'xlink:href':prop.backgroundImage,preserveAspectRatio:prop.backgroundImageAspect||'none',x:prop.gutterLeft,y:prop.gutterTop};if(prop.backgroundImageStretch){attr.x=prop.gutterLeft+prop.variant3dOffsetx;attr.y=prop.gutterTop+prop.variant3dOffsety;attr.width=obj.width-prop.gutterLeft-prop.gutterRight;attr.height=obj.height-prop.gutterTop-prop.gutterBottom;}else{if(typeof prop.backgroundImageX==='number'){attr.x=prop.backgroundImageX+prop.variant3dOffsetx;}else{attr.x=prop.gutterLeft+prop.variant3dOffsetx;}
47
+ if(typeof prop.backgroundImageY==='number'){attr.y=prop.backgroundImageY+prop.variant3dOffsety;}else{attr.y=prop.gutterTop+prop.variant3dOffsety;}
45
48
  if(typeof prop.backgroundImageW==='number'){attr.width=prop.backgroundImageW;}
46
49
  if(typeof prop.backgroundImageH==='number'){attr.height=prop.backgroundImageH;}}
47
50
  if(prop.variant==='3d'){attr.x+=prop.variant3dOffsetx;attr.y-=prop.variant3dOffsety;}
48
- var img=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'image',attr:attr,style:{opacity:typeof prop.backgroundImageOpacity==='number'?prop.backgroundImageOpacity:1}});}
49
- if(prop.backgroundGrid){var parts=[];if(prop.backgroundGridHlines){var count=typeof prop.backgroundGridHlinesCount==='number'?prop.backgroundGridHlinesCount:(obj.type==='hbar'?(prop.yaxisLabels.length||obj.data.length||5):prop.yaxisLabelsCount);for(var i=0;i<=count;++i){parts.push('M{1} {2} L{3} {4}'.format(prop.gutterLeft+prop.variant3dOffsetx,prop.gutterTop+(obj.graphHeight/count)*i-prop.variant3dOffsety,obj.width-prop.gutterRight+prop.variant3dOffsetx,prop.gutterTop+(obj.graphHeight/count)*i-prop.variant3dOffsety));}
51
+ var img=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'image',attr:attr,style:{opacity:typeof prop.backgroundImageOpacity==='number'?prop.backgroundImageOpacity:1}});if(!prop.backgroundImageStretch){var img2=new Image();img2.src=prop.backgroundImage;img2.onload=function()
52
+ {img.setAttribute('width',typeof prop.backgroundImageW==='number'?prop.backgroundImageW:img2.width);img.setAttribute('height',typeof prop.backgroundImageH==='number'?prop.backgroundImageH:img2.height);};}}
53
+ if(prop.backgroundGrid){var parts=[];if(prop.backgroundGridHlines){if(typeof prop.backgroundGridHlinesCount==='number'){var count=prop.backgroundGridHlinesCount;}else if(obj.type==='hbar'||obj.type==='bipolar'){if(typeof prop.yaxisLabels==='object'&&!RG.SVG.isNull(prop.yaxisLabels)&&prop.yaxisLabels.length){var count=prop.yaxisLabels.length;}else if(obj.type==='hbar'){var count=obj.data.length;}else if(obj.type==='bipolar'){var count=obj.left.length;}}else{var count=prop.yaxisLabelsCount||5;}
54
+ for(var i=0;i<=count;++i){parts.push('M{1} {2} L{3} {4}'.format(prop.gutterLeft+prop.variant3dOffsetx,prop.gutterTop+(obj.graphHeight/count)*i-prop.variant3dOffsety,obj.width-prop.gutterRight+prop.variant3dOffsetx,prop.gutterTop+(obj.graphHeight/count)*i-prop.variant3dOffsety));}
50
55
  parts.push('M{1} {2} L{3} {4}'.format(prop.gutterLeft+prop.variant3dOffsetx,obj.height-prop.gutterBottom-prop.variant3dOffsety,obj.width-prop.gutterRight+prop.variant3dOffsetx,obj.height-prop.gutterBottom-prop.variant3dOffsety));}
51
- if(prop.backgroundGridVlines){if(obj.type==='line'&&RG.SVG.isArray(obj.data[0])){var len=obj.data[0].length;}else if(obj.type==='hbar'){var len=prop.xaxisLabelsCount||10;}else if(obj.type==='scatter'){var len=(prop.xaxisLabels&&prop.xaxisLabels.length)||10;}else{var len=obj.data.length;}
56
+ if(prop.backgroundGridVlines){if(obj.type==='line'&&RG.SVG.isArray(obj.data[0])){var len=obj.data[0].length;}else if(obj.type==='hbar'){var len=prop.xaxisLabelsCount||10;}else if(obj.type==='bipolar'){var len=prop.xaxisLabelsCount||10;}else if(obj.type==='scatter'){var len=(prop.xaxisLabels&&prop.xaxisLabels.length)||10;}else if(obj.type==='waterfall'){var len=obj.data[0].length;}else{var len=obj.data.length;}
52
57
  var count=typeof prop.backgroundGridVlinesCount==='number'?prop.backgroundGridVlinesCount:len;if(prop.xaxisLabelsPosition==='edge'){count--;}
53
58
  for(var i=0;i<=count;++i){parts.push('M{1} {2} L{3} {4}'.format(prop.gutterLeft+((obj.graphWidth/count)*i)+prop.variant3dOffsetx,prop.gutterTop-prop.variant3dOffsety,prop.gutterLeft+((obj.graphWidth/count)*i)+prop.variant3dOffsetx,obj.height-prop.gutterBottom-prop.variant3dOffsety));}}
54
59
  if(prop.backgroundGridBorder){parts.push('M{1} {2} L{3} {4} L{5} {6} L{7} {8} z'.format(prop.gutterLeft+prop.variant3dOffsetx,prop.gutterTop-prop.variant3dOffsety,obj.width-prop.gutterRight+prop.variant3dOffsetx,prop.gutterTop-prop.variant3dOffsety,obj.width-prop.gutterRight+prop.variant3dOffsetx,obj.height-prop.gutterBottom-prop.variant3dOffsety,prop.gutterLeft+prop.variant3dOffsetx,obj.height-prop.gutterBottom-prop.variant3dOffsety));}
55
60
  var dasharray;if(prop.backgroundGridDashed){dasharray=[3,5];}else if(prop.backgroundGridDotted){dasharray=[1,3];}else if(prop.backgroundGridDashArray){dasharray=prop.backgroundGridDashArray;}else{dasharray='';}
56
- var grid=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{d:parts.join(' '),stroke:prop.backgroundGridColor,fill:'rgba(0,0,0,0)','stroke-width':prop.backgroundGridLinewidth,'shape-rendering':"crispEdges",'stroke-dasharray':dasharray}});}
57
- RG.SVG.drawTitle(obj);};RG.SVG.isNull=function(arg)
61
+ var grid=RG.SVG.create({svg:obj.svg,parent:obj.svg.all,type:'path',attr:{className:'rgraph_background_grid',d:parts.join(' '),stroke:prop.backgroundGridColor,fill:'rgba(0,0,0,0)','stroke-width':prop.backgroundGridLinewidth,'shape-rendering':"crispEdges",'stroke-dasharray':dasharray},style:{pointerEvents:'none'}});}
62
+ if(obj.type!=='bipolar'){RG.SVG.drawTitle(obj);}};RG.SVG.isNull=function(arg)
58
63
  {if(arg==null||typeof arg==='object'&&!arg){return true;}
59
64
  return false;};RG.SVG.getScale=function(opt)
60
65
  {var obj=opt.object,prop=obj.properties,numlabels=opt.numlabels,unitsPre=opt.unitsPre,unitsPost=opt.unitsPost,max=Number(opt.max),min=Number(opt.min),strict=opt.strict,decimals=Number(opt.decimals),point=opt.point,thousand=opt.thousand,originalMax=max,round=opt.round,scale={max:1,labels:[],values:[]},formatter=opt.formatter;if(max===0&&min===0){var max=1;for(var i=0;i<numlabels;++i){var label=((((max-min)/numlabels)*(i+1))+min).toFixed(decimals);scale.labels.push(unitsPre+label+unitsPost);scale.values.push(parseFloat(label))}}else if(max<=1&&!strict){var arr=[1,0.5,0.10,0.05,0.010,0.005,0.0010,0.0005,0.00010,0.00005,0.000010,0.000005,0.0000010,0.0000005,0.00000010,0.00000005,0.000000010,0.000000005,0.0000000010,0.0000000005,0.00000000010,0.00000000005,0.000000000010,0.000000000005,0.0000000000010,0.0000000000005],vals=[];for(var i=0;i<arr.length;++i){if(max>arr[i]){i--;break;}}
@@ -67,7 +72,7 @@ scale.max=topValue;for(var i=0;i<numlabels;++i){var label=RG.SVG.numberFormat({o
67
72
  scale.max=max;}
68
73
  scale.unitsPre=unitsPre;scale.unitsPost=unitsPost;scale.point=point;scale.decimals=decimals;scale.thousand=thousand;scale.numlabels=numlabels;scale.round=Boolean(round);scale.min=min;for(var i=0;i<scale.values.length;++i){scale.values[i]=parseFloat(scale.values[i]);}
69
74
  return scale;};RG.SVG.arrayFill=RG.SVG.arrayPad=function(opt)
70
- {var arr=opt.array,len=opt.length,value=(opt.value?opt.value:null);if(arr.length<len){for(var i=arr.length;i<len;i+=1){arr[i]=value;}}
75
+ {var arr=opt.array,len=opt.length,value=(typeof opt.value==='undefined'?null:opt.value);if(arr.length<len){for(var i=arr.length;i<len;i+=1){arr[i]=value;}}
71
76
  return arr;};RG.SVG.arraySum=function(arr)
72
77
  {if(typeof arr==='number'){return arr;}
73
78
  if(RG.SVG.isNull(arr)){return 0;}
@@ -123,13 +128,28 @@ if(decimal.length){output=output+decimal_seperator+decimal;decimal='';RegExp.$1=
123
128
  if(decimals_trim){output=output.replace(/0+$/,'');output=output.replace(/\.$/,'');}
124
129
  if(output.charAt(0)=='-'){output=output.replace(/-/,'');prepend='-'+prepend;}
125
130
  return prepend+output+append;};RG.SVG.text=function(opt)
126
- {var obj=opt.object,parent=opt.parent||opt.object.svg.all,size=opt.size,bold=opt.bold,font=opt.font,italic=opt.italic,halign=opt.halign,valign=opt.valign,str=opt.text,x=opt.x,y=opt.y,color=opt.color?opt.color:'black',background=opt.background||null,padding=opt.padding||0,link=opt.link||'',linkTarget=opt.linkTarget||'_blank';if(halign==='right'){halign='end';}else if(halign==='center'||halign==='middle'){halign='middle';}else{halign='start';}
131
+ {var obj=opt.object,parent=opt.parent||opt.object.svg.all,size=typeof opt.size==='number'?opt.size+'pt':(typeof opt.size==='string'?opt.size.replace(/pt$/,''):12)+'pt',bold=opt.bold?'bold':'normal',font=opt.font?opt.font:'sans-serif',italic=opt.italic?'italic':'normal',halign=opt.halign,valign=opt.valign,str=opt.text,x=opt.x,y=opt.y,color=opt.color?opt.color:'black',background=opt.background||null,backgroundRounded=opt.backgroundRounded||null,padding=opt.padding||0,link=opt.link||'',linkTarget=opt.linkTarget||'_blank',events=(opt.events===false?false:true),angle=opt.angle;if(typeof str==='number'){str=String(str);}
132
+ if(RG.SVG.isNull(str)){str='';}
133
+ if(str&&str.substr(0,2)=='\r\n'||str.substr(0,1)==='\n'){str="\u00A0"+str;}
134
+ if(halign==='right'){halign='end';}else if(halign==='center'||halign==='middle'){halign='middle';}else{halign='start';}
127
135
  if(valign==='top'){valign='hanging';}else if(valign==='center'||valign==='middle'){valign='central';valign='middle';}else{valign='bottom';}
128
- if(link){var a=RGraph.SVG.create({svg:bar.svg,type:'a',parent:opt.parent,attr:{'xlink:href':link,target:linkTarget}});}
129
- var text=RG.SVG.create({svg:obj.svg,parent:link?a:opt.parent,type:'text',attr:{fill:color,x:x,y:y,'font-size':typeof size==='number'?size+'pt':size,'font-weight':bold?900:100,'font-family':font?font:'sans-serif','font-style':italic?'italic':'normal','text-anchor':halign,'dominant-baseline':valign}});var textNode=document.createTextNode(str);text.appendChild(textNode);if(typeof background==='string'){var bbox=text.getBBox(),rect=RG.SVG.create({svg:obj.svg,parent:opt.parent,type:'rect',attr:{x:bbox.x-padding,y:bbox.y-padding,width:bbox.width+(padding*2),height:bbox.height+(padding*2),fill:background}});parent.insertBefore(rect,text);}
130
- if(RG.SVG.ISIE&&(valign==='hanging')){text.setAttribute('y',y+(text.scrollHeight/2));}else if(RG.SVG.ISIE&&valign==='middle'){text.setAttribute('y',y+(text.scrollHeight/3));}
131
- if(RG.SVG.ISFF){Y=y+(text.scrollHeight/3);}
132
- return text;};RG.SVG.createUID=function()
136
+ if(link){var a=RGraph.SVG.create({svg:obj.svg,type:'a',parent:parent,attr:{'xlink:href':link,target:linkTarget}});}
137
+ if(str&&str.indexOf&&str.indexOf("\n")===-1){var text=RG.SVG.create({svg:obj.svg,parent:link?a:opt.parent,type:'text',attr:{tag:opt.tag?opt.tag:'',fill:color,x:x,y:y,'font-size':size,'font-weight':bold,'font-family':font,'font-style':italic,'text-anchor':halign,'dominant-baseline':valign}});var textNode=document.createTextNode(str);text.appendChild(textNode);if(!events){text.style.pointerEvents='none';}}else if(str&&str.indexOf){var dimensions=RG.SVG.measureText({text:'My',bold:bold,font:font,size:size});var lineHeight=dimensions[1];str=str.split(/\r?\n/);if(valign==='bottom'){y-=str.length*lineHeight;}
138
+ if(valign==='center'||valign==='middle'){y-=(str.length*lineHeight)/2;}
139
+ var text=RG.SVG.create({svg:obj.svg,parent:link?a:opt.parent,type:'text',attr:{tag:opt.tag?opt.tag:'',fill:color,x:x,y:y,'font-size':size,'font-weight':bold,'font-family':font,'font-style':italic,'text-anchor':halign,'dominant-baseline':valign}});if(!events){text.style.pointerEvents='none';}
140
+ for(var i=0;i<str.length;++i){var tspan=RG.SVG.create({svg:obj.svg,parent:text,type:'tspan',attr:{x:x,dy:dimensions?(dimensions[1]*(i?1:0))+3:0}});var textNode=document.createTextNode(str[i]);tspan.appendChild(textNode);if(!events){tspan.style.pointerEvents='none';}
141
+ var dimensions=RG.SVG.measureText({text:str[i],bold:bold,font:font,size:parseInt(size)});}}
142
+ if(typeof angle==='number'&&angle&&text){text.setAttribute('x',0);text.setAttribute('y',0);text.setAttribute('transform','translate({1} {2}) rotate({3})'.format(x,y,-1*angle));}
143
+ if(typeof background==='string'){var parent=link?a:parent;var bbox=text.getBBox(),rect=RG.SVG.create({svg:obj.svg,parent:parent,type:'rect',attr:{x:bbox.x-padding,y:bbox.y-padding,width:bbox.width+(padding*2),height:bbox.height+(padding*2),fill:background,rx:backgroundRounded,ry:backgroundRounded}});if(!events){rect.style.pointerEvents='none';}
144
+ text.parentNode.insertBefore(rect,text);}
145
+ if(RG.SVG.ISIE&&(valign==='hanging')&&text){text.setAttribute('y',y+(text.scrollHeight/2));}else if(RG.SVG.ISIE&&valign==='middle'){text.setAttribute('y',y+(text.scrollHeight/3));}
146
+ if(RG.SVG.ISFF&&text){Y=y+(text.scrollHeight/3);}
147
+ return text;};RG.SVG.text.find=function(opt)
148
+ {if(typeof opt.object==='object'&&opt.object.isRGraph){var svg=opt.object.svg;}else if(typeof opt.svg==='object'&&opt.svg.all){var svg=opt.svg;}
149
+ var nodes=svg.getElementsByTagName('text');var found=[];for(var i=0,len=nodes.length;i<len;++i){var text=false,tag=false;if(typeof opt.text==='string'&&nodes[i].innerHTML===opt.text){text=true;}else if(typeof opt.text==='object'&&nodes[i].innerHTML.match(opt.text)){text=true;}else if(typeof opt.text==='undefined'){text=true;}
150
+ if(typeof opt.tag==='string'&&nodes[i].getAttribute('tag')===opt.tag){tag=true;}else if(typeof opt.tag==='object'&&nodes[i].getAttribute('tag').match(opt.tag)){tag=true;}else if(typeof opt.tag==='undefined'){tag=true;}
151
+ if(text===true&&tag===true){found.push(nodes[i])}}
152
+ return found;};RG.SVG.createUID=function()
133
153
  {return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c)
134
154
  {var r=ma.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);});};RG.SVG.isFixed=function(svg)
135
155
  {var obj=svg.parentNode,i=0;while(obj&&obj.tagName.toLowerCase()!='body'&&i<99){if(obj.style.position==='fixed'){return obj;}
@@ -147,8 +167,16 @@ if(tooltip&&tooltip.__object__){RG.SVG.removeHighlight(tooltip.__object__);}};RG
147
167
  if(typeof data[group]=='number'){group++
148
168
  grouped_index=0;continue;}
149
169
  grouped_index++;if(grouped_index>=data[group].length){group++;grouped_index=0;}}
150
- return[group,grouped_index];};RG.SVG.TRIG.toCartesian=function(options)
151
- {return{x:options.cx+(options.r*ma.cos(options.angle)),y:options.cy+(options.r*ma.sin(options.angle))};};RG.SVG.TRIG.getArcPath=function(options)
170
+ return[group,grouped_index];};RG.SVG.groupedIndexToSequential=function(opt)
171
+ {var dataset=opt.dataset,index=opt.index,obj=opt.object;for(var i=0,seq=0;i<=dataset;++i){for(var j=0;j<obj.data[dataset].length;++j){if(i===dataset&&j===index){return seq;}
172
+ seq++;}}
173
+ return seq;};RG.SVG.TRIG.toCartesian=function(options)
174
+ {return{x:options.cx+(options.r*ma.cos(options.angle)),y:options.cy+(options.r*ma.sin(options.angle))};};RG.SVG.TRIG.getHypLength=function(opt)
175
+ {var h=Math.abs(opt.x2-opt.x1)
176
+ v=Math.abs(opt.y2-opt.y1),r=Math.sqrt((h*h)
177
+ +(v*v));return r;};RG.SVG.TRIG.getAngleByXY=function(opt)
178
+ {var cx=opt.cx,cy=opt.cy,x=opt.x,y=opt.y;var angle=ma.atan((y-cy)/(x-cx));if(x>=cx&&y>=cy){angle+=RG.SVG.TRIG.HALFPI;}else if(x>=cx&&y<cy){angle=angle+RG.SVG.TRIG.HALFPI;}else if(x<cx&&y<cy){angle=angle+RG.SVG.TRIG.PI+RG.SVG.TRIG.HALFPI;}else{angle=angle+RG.SVG.TRIG.PI+RG.SVG.TRIG.HALFPI;}
179
+ return angle;};RG.SVG.TRIG.getArcPath=function(options)
152
180
  {options.start-=1.57;options.end-=1.57;var start=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.start});var end=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.end});var diff=options.end-options.start;var largeArc='0';var sweep='0';if(options.anticlockwise&&diff>3.14){largeArc='0';sweep='0';}else if(options.anticlockwise&&diff<=3.14){largeArc='1';sweep='0';}else if(!options.anticlockwise&&diff>3.14){largeArc='1';sweep='1';}else if(!options.anticlockwise&&diff<=3.14){largeArc='0';sweep='1';}
153
181
  if(options.start>options.end&&options.anticlockwise&&diff<=3.14){largeArc='0';sweep='0';}
154
182
  if(options.start>options.end&&options.anticlockwise&&diff>3.14){largeArc='1';sweep='1';}
@@ -157,7 +185,7 @@ if(options.array===true){return d;}else{return d.join(" ");}};RG.SVG.TRIG.getArc
157
185
  {options.start-=1.57;options.end-=1.57;var start=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.start});var end=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.end});var diff=ma.abs(options.end-options.start);var largeArc='0';var sweep='0';if(!options.anticlockwise){if(diff>RG.SVG.TRIG.PI){largeArc='1';sweep='1';}else{largeArc='0';sweep='1';}}else{if(diff>RG.SVG.TRIG.PI){largeArc='1';sweep='0';}else{largeArc='0';sweep='0';}}
158
186
  if(typeof options.lineto==='boolean'&&options.lineto===false){var d=["M",start.x,start.y,"A",options.r,options.r,0,largeArc,sweep,end.x,end.y];}else{var d=["M",options.cx,options.cy,"L",start.x,start.y,"A",options.r,options.r,0,largeArc,sweep,end.x,end.y];}
159
187
  if(options.array===true){return d;}else{return d.join(" ");}};RG.SVG.TRIG.getArcPath3=function(options)
160
- {options.start-=1.57;options.end-=1.57;var start=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.start});var end=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.end});var diff=ma.abs(options.end-options.start);var largeArc='0';var sweep='0';if(!options.anticlockwise){if(diff>RG.SVG.TRIG.PI){largeArc='1';sweep='1';}else{largeArc='0';sweep='1';}}else{if(diff>RG.SVG.TRIG.PI){largeArc='1';sweep='0';}else{largeArc='0';sweep='0';}}
188
+ {options.start-=(ma.PI/2);options.end-=(ma.PI/2);var start=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.start});var end=RG.SVG.TRIG.toCartesian({cx:options.cx,cy:options.cy,r:options.r,angle:options.end});var diff=ma.abs(options.end-options.start);var largeArc='0';var sweep='0';if(!options.anticlockwise){if(diff>RG.SVG.TRIG.PI){largeArc='1';sweep='1';}else{largeArc='0';sweep='1';}}else{if(diff>RG.SVG.TRIG.PI){largeArc='1';sweep='0';}else{largeArc='0';sweep='0';}}
161
189
  if(typeof options.lineto==='boolean'&&options.lineto===false){var d=["M",start.x,start.y,"A",options.r,options.r,0,largeArc,sweep,end.x,end.y];}else{var d=["L",start.x,start.y,"A",options.r,options.r,0,largeArc,sweep,end.x,end.y];}
162
190
  if(options.array===true){return d;}else{return d.join(" ");}};RG.SVG.TRIG.getRadiusEndPoint=function(opt)
163
191
  {if(arguments.length===1){var angle=opt.angle,r=opt.r;}else if(arguments.length===4){var angle=arguments[0],r=arguments[1];}
@@ -169,17 +197,17 @@ if(prop.titleSubtitle&&typeof prop.titleSubtitleY!=='number'&&!positionBottom){p
169
197
  prop.titleSubTitleSize=prop.titleSubTitleSize||prop.textSize;prop.titleSubtitleY=prop.titleSubtitleY||prop.titleY+18;if(positionBottom&&typeof prop.titleSubtitleY!=='number'){prop.titleSubtitleY=prop.titleY+26;}
170
198
  if(prop.title){var x=typeof prop.titleX==='number'?prop.titleX+(prop.variant3dOffsetx||0):prop.gutterLeft+(obj.graphWidth/2)+(prop.variant3dOffsetx||0);var y=prop.titleY+(prop.variant3dOffsety||0);if(typeof originalTitleX==='string'){x+=parseFloat(originalTitleX);}
171
199
  if(typeof originalTitleY==='string'){y+=parseFloat(originalTitleY);}
172
- RG.SVG.text({object:obj,svg:obj.svg,parent:obj.svg.all,text:prop.title.toString(),size:prop.titleSize||(prop.textSize+4)||16,x:x,y:y,halign:prop.titleHalign||'center',valign:prop.titleValign||valign,color:prop.titleColor||prop.textColor||'black',bold:prop.titleBold||false,italic:prop.titleItalic||false,font:prop.titleFont||prop.textFont||'Arial'});}
200
+ RG.SVG.text({object:obj,svg:obj.svg,parent:obj.svg.all,tag:'title',text:prop.title.toString(),size:prop.titleSize||(prop.textSize+4)||16,x:x,y:y,halign:prop.titleHalign||'center',valign:prop.titleValign||valign,color:prop.titleColor||prop.textColor||'black',bold:prop.titleBold||false,italic:prop.titleItalic||false,font:prop.titleFont||prop.textFont||'Arial'});}
173
201
  if(typeof prop.title==='string'&&typeof prop.titleSubtitle==='string'){y+=(prop.titleSubtitleSize*1.5);if(typeof originalTitleSubtitleX==='number'){x=originalTitleSubtitleX;}
174
202
  if(typeof originalTitleSubtitleY==='number'){y=originalTitleSubtitleY;}
175
203
  if(typeof originalTitleSubtitleX==='string'){x+=parseFloat(originalTitleSubtitleX);}
176
204
  if(typeof originalTitleSubtitleY==='string'){y+=parseFloat(originalTitleSubtitleY);}
177
- RG.SVG.text({object:obj,svg:obj.svg,parent:obj.svg.all,text:prop.titleSubtitle,size:prop.titleSubtitleSize,x:x,y:y,halign:prop.titleSubtitleHalign||'center',valign:prop.titleSubtitleValign||valign,color:prop.titleSubtitleColor||prop.textColor||'#aaa',bold:prop.titleSubtitleBold||false,italic:prop.titleSubtitleItalic||false,font:prop.titleSubtitleFont||prop.textFont||'Arial'});}};RG.SVG.trim=function(str)
205
+ RG.SVG.text({object:obj,svg:obj.svg,parent:obj.svg.all,tag:'subtitle',text:prop.titleSubtitle,size:prop.titleSubtitleSize,x:x,y:y,halign:prop.titleSubtitleHalign||'center',valign:prop.titleSubtitleValign||valign,color:prop.titleSubtitleColor||prop.textColor||'#aaa',bold:prop.titleSubtitleBold||false,italic:prop.titleSubtitleItalic||false,font:prop.titleSubtitleFont||prop.textFont||'Arial'});}};RG.SVG.trim=function(str)
178
206
  {return RG.SVG.ltrim(RG.SVG.rtrim(str));};RG.SVG.ltrim=function(str)
179
207
  {return String(str).replace(/^(\s|\0)+/,'');};RG.SVG.rtrim=function(str)
180
208
  {return String(str).replace(/(\s|\0)+$/,'');};RG.SVG.parseColorLinear=function(opt)
181
209
  {var obj=opt.object,color=opt.color;if(!color||typeof color!=='string'){return color;}
182
- if(color.match(/^gradient\((.*)\)$/i)){var parts=RegExp.$1.split(':'),diff=1/(parts.length-1);if(opt&&opt.direction&&opt.direction==='horizontal'){var grad=RG.SVG.create({type:'linearGradient',parent:obj.svg.defs,attr:{id:'RGraph-linear-gradient-'+obj.uid+'-'+obj.gradientCounter,x1:opt.start||0,x2:opt.end||'100%',y1:0,y2:0,gradientUnits:"userSpaceOnUse"}});}else{var grad=RG.SVG.create({type:'linearGradient',parent:obj.svg.defs,attr:{id:'RGraph-linear-gradient-'+obj.uid+'-'+obj.gradientCounter,x1:0,x2:0,y1:opt.start||0,y2:opt.end||'100%',gradientUnits:"userSpaceOnUse"}});}
210
+ if(color.match(/^gradient\((.*)\)$/i)){var parts=RegExp.$1.split(':'),diff=1/(parts.length-1);if(opt&&opt.direction&&opt.direction==='horizontal'){var grad=RG.SVG.create({type:'linearGradient',parent:obj.svg.defs,attr:{id:'RGraph-linear-gradient-'+obj.uid+'-'+obj.gradientCounter,x1:opt.start||0,x2:opt.end||'100%',y1:0,y2:0,gradientUnits:opt.gradientUnits||"userSpaceOnUse"}});}else{var grad=RG.SVG.create({type:'linearGradient',parent:obj.svg.defs,attr:{id:'RGraph-linear-gradient-'+obj.uid+'-'+obj.gradientCounter,x1:0,x2:0,y1:opt.start||0,y2:opt.end||'100%',gradientUnits:opt.gradientUnits||"userSpaceOnUse"}});}
183
211
  var stop=RG.SVG.create({type:'stop',parent:grad,attr:{offset:'0%','stop-color':RG.SVG.trim(parts[0])}});for(var j=1,len=parts.length;j<len;++j){RG.SVG.create({type:'stop',parent:grad,attr:{offset:(j*diff*100)+'%','stop-color':RG.SVG.trim(parts[j])}});}}
184
212
  color=grad?'url(#RGraph-linear-gradient-'+obj.uid+'-'+(obj.gradientCounter++)+')':color;return color;};RG.SVG.parseColorRadial=function(opt)
185
213
  {var obj=opt.object,color=opt.color;if(!color||typeof color!=='string'){return color;}
@@ -189,7 +217,8 @@ color=grad?'url(#RGraph-radial-gradient-'+obj.uid+'-'+(obj.gradientCounter++)+')
189
217
  if(typeof obj.resetColorsToOriginalValues==='function'){obj.resetColorsToOriginalValues();}
190
218
  obj.originalColors={};obj.colorsParsed=false;obj.gradientCounter=1;};RG.SVG.clear=function(svg)
191
219
  {for(var i=1;i<=100;++i){if(svg['background'+i]){while(svg['background'+i].lastChild){svg['background'+i].removeChild(svg['background'+i].lastChild);}}else{break;}}
192
- while(svg.all.lastChild){svg.all.removeChild(svg.all.lastChild);}};RG.SVG.addCustomEventListener=function(obj,name,func)
220
+ while(svg.all.lastChild){svg.all.removeChild(svg.all.lastChild);}
221
+ if(svg.all.line_tooltip_hotspots){while(svg.all.line_tooltip_hotspots.lastChild){svg.all.line_tooltip_hotspots.removeChild(svg.all.line_tooltip_hotspots.lastChild);}}};RG.SVG.addCustomEventListener=function(obj,name,func)
193
222
  {if(typeof RG.SVG.events[obj.uid]==='undefined'){RG.SVG.events[obj.uid]=[];}
194
223
  if(name.substr(0,2)!=='on'){name='on'+name;}
195
224
  RG.SVG.events[obj.uid].push({object:obj,event:name,func:func});return RG.SVG.events[obj.uid].length-1;};RG.SVG.fireCustomEvent=function(obj,name)
@@ -202,7 +231,7 @@ RG.SVG.events[obj.uid].push({object:obj,event:name,func:func});return RG.SVG.eve
202
231
  var sep='[-./_=+~#:;,]+';var tokens=str.split(/ +/);for(var i=0,len=tokens.length;i<len;++i){if(tokens[i]){if(tokens[i].match(/^\d\d\d\d$/)){defaults.year=tokens[i];}
203
232
  var res=isMonth(tokens[i]);if(typeof res==='number'){defaults.month=res+1;}
204
233
  if(tokens[i].match(/^\d?\d(?:st|nd|rd|th)?$/)){defaults.date=parseInt(tokens[i]);}
205
- if(tokens[i].match(/^(\d\d):(\d\d)(?:(\d\d))?$/)){defaults.hours=parseInt(RegExp.$1);defaults.minutes=parseInt(RegExp.$2);if(RegExp.$3){defaults.seconds=parseInt(RegExp.$3);}}
234
+ if(tokens[i].match(/^(\d\d):(\d\d):?(?:(\d\d))?$/)){defaults.hours=parseInt(RegExp.$1);defaults.minutes=parseInt(RegExp.$2);if(RegExp.$3){defaults.seconds=parseInt(RegExp.$3);}}
206
235
  if(tokens[i].match(new RegExp('^(\\d\\d\\d\\d)'+sep+'(\\d\\d)'+sep+'(\\d\\d)$','i'))){defaults.date=parseInt(RegExp.$3);defaults.month=parseInt(RegExp.$2);defaults.year=parseInt(RegExp.$1);}
207
236
  if(tokens[i].match(new RegExp('^(\\d\\d)'+sep+'(\\d\\d)'+sep+'(\\d\\d\\d\\d)$','i'))){defaults.date=parseInt(RegExp.$1);defaults.month=parseInt(RegExp.$2);defaults.year=parseInt(RegExp.$3);}}}
208
237
  str='{1}/{2}/{3} {4}:{5}:{6}'.format(defaults.year,String(defaults.month).length===1?'0'+(defaults.month):defaults.month,String(defaults.date).length===1?'0'+(defaults.date):defaults.date,String(defaults.hours).length===1?'0'+(defaults.hours):defaults.hours,String(defaults.minutes).length===1?'0'+(defaults.minutes):defaults.minutes,String(defaults.seconds).length===1?'0'+(defaults.seconds):defaults.seconds);return Date.parse(str);function isMonth(str)
@@ -225,7 +254,7 @@ return[x+paddingLeft+borderLeft,y+paddingTop+borderTop];};RG.SVG.FX.update=funct
225
254
  {var text=opt.text||'',bold=opt.bold||false,font=opt.font||'Arial',size=opt.size||10,str=text+':'+bold+':'+font+':'+size;if(typeof RG.SVG.measuretext_cache==='undefined'){RG.SVG.measuretext_cache=[];}
226
255
  if(typeof RG.SVG.measuretext_cache=='object'&&RG.SVG.measuretext_cache[str]){return RG.SVG.measuretext_cache[str];}
227
256
  if(!RG.SVG.measuretext_cache['text-span']){var span=document.createElement('SPAN');span.style.position='absolute';span.style.padding=0;span.style.display='inline';span.style.top='-200px';span.style.left='-200px';span.style.lineHeight='1em';document.body.appendChild(span);RG.SVG.measuretext_cache['text-span']=span;}else if(RG.SVG.measuretext_cache['text-span']){var span=RG.SVG.measuretext_cache['text-span'];}
228
- span.innerHTML=text.replace(/\r\n/g,'<br />');span.style.fontFamily=font;span.style.fontWeight=bold?'bold':'normal';span.style.fontSize=size+'pt';var sizes=[span.offsetWidth,span.offsetHeight];RG.SVG.measuretext_cache[str]=sizes;return sizes;};RG.SVG.stringsToNumbers=function(str)
257
+ span.innerHTML=text.replace(/\r?\n/g,'<br />');span.style.fontFamily=font;span.style.fontWeight=bold?'bold':'normal';span.style.fontSize=String(size).replace(/pt$/,'')+'pt';var sizes=[span.offsetWidth,span.offsetHeight];RG.SVG.measuretext_cache[str]=sizes;return sizes;};RG.SVG.stringsToNumbers=function(str)
229
258
  {var sep=arguments[1]||',';if(typeof str==='number'){return str;}
230
259
  if(typeof str==='string'){if(str.indexOf(sep)!=-1){str=str.split(sep);}else{str=parseFloat(str);}}
231
260
  if(typeof str==='object'){for(var i=0,len=str.length;i<len;i+=1){str[i]=parseFloat(str[i]);}}
@@ -241,7 +270,19 @@ return{name:name,value:value};};RG.SVG.log=function(opt)
241
270
  {var num=opt.num,base=opt.base;return ma.log(num)/(base?ma.log(base):1);};RG.SVG.donut=function(opt)
242
271
  {var arcPath1=RG.SVG.TRIG.getArcPath3({cx:opt.cx,cy:opt.cy,r:opt.outerRadius,start:0,end:RG.SVG.TRIG.TWOPI,anticlockwise:false,lineto:false});var arcPath2=RG.SVG.TRIG.getArcPath3({cx:opt.cx,cy:opt.cy,r:opt.innerRadius,start:RG.SVG.TRIG.TWOPI,end:0,anticlockwise:true,lineto:false});var path=RG.SVG.create({svg:opt.svg,type:'path',attr:{d:arcPath1+arcPath2,stroke:opt.stroke,fill:opt.fill}});return path;};RG.SVG.getGlobals=function(obj)
243
272
  {var prop=obj.properties;for(i in RG.SVG.GLOBALS){if(typeof i==='string'){prop[i]=RG.SVG.arrayClone(RG.SVG.GLOBALS[i]);}}};RG.SVG.link=function(opt)
244
- {var a=RGraph.SVG.create({svg:bar.svg,type:'a',parent:bar.svg.all,attr:{'xlink:href':href,target:target}});var text=RGraph.SVG.create({svg:bar.svg,type:'text',parent:a,attr:{x:x,y:y,fill:fill}});text.innerHTML=text;};if(typeof RG.SVG.tooltip!=='function'){RG.SVG.tooltip=function()
273
+ {var a=RGraph.SVG.create({svg:bar.svg,type:'a',parent:bar.svg.all,attr:{'xlink:href':href,target:target}});var text=RGraph.SVG.create({svg:bar.svg,type:'text',parent:a,attr:{x:x,y:y,fill:fill}});text.innerHTML=text;};RG.SVG.getErrorbarsMaxValue=function(opt)
274
+ {var obj=opt.object,prop=obj.properties,index=opt.index;if(typeof prop.errorbars==='object'&&!RG.SVG.isNull(prop.errorbars)&&typeof prop.errorbars[index]==='number'){var value=prop.errorbars[index];}else if(typeof prop.errorbars==='object'&&!RG.SVG.isNull(prop.errorbars)&&typeof prop.errorbars[index]==='object'&&!RG.SVG.isNull(prop.errorbars[index])&&typeof prop.errorbars[index].max==='number'){var value=prop.errorbars[index].max;}else{var value=0;}
275
+ return value;};RG.SVG.getErrorbarsMinValue=function(opt)
276
+ {var obj=opt.object,prop=obj.properties,index=opt.index;if(typeof prop.errorbars==='object'&&!RG.SVG.isNull(prop.errorbars)&&typeof prop.errorbars[index]==='object'&&!RG.SVG.isNull(prop.errorbars[index])&&typeof prop.errorbars[index].min==='number'){var value=prop.errorbars[index].min;}else{var value=null;}
277
+ return value;};RG.SVG.getErrorbarsColor=function(opt)
278
+ {var obj=opt.object,prop=obj.properties,index=opt.index;var color=prop.errorbarsColor||'black';if(typeof prop.errorbars==='object'&&!RG.SVG.isNull(prop.errorbars)&&typeof prop.errorbars[index]==='object'&&!RG.SVG.isNull(prop.errorbars[index])&&typeof prop.errorbars[index].color==='string'){color=prop.errorbars[index].color;}
279
+ return color;};RG.SVG.getErrorbarsLinewidth=function(opt)
280
+ {var obj=opt.object,prop=obj.properties,index=opt.index;var linewidth=prop.errorbarsLinewidth||1
281
+ if(typeof prop.errorbars==='object'&&!RG.SVG.isNull(prop.errorbars)&&typeof prop.errorbars[index]==='object'&&!RG.SVG.isNull(prop.errorbars[index])&&typeof prop.errorbars[index].linewidth==='number'){linewidth=prop.errorbars[index].linewidth;}
282
+ return linewidth;};RG.SVG.getErrorbarsCapWidth=function(opt)
283
+ {var obj=opt.object,prop=obj.properties,index=opt.index;var capwidth=prop.errorbarsCapwidth||10
284
+ if(typeof prop.errorbars==='object'&&!RG.SVG.isNull(prop.errorbars)&&typeof prop.errorbars[index]==='object'&&!RG.SVG.isNull(prop.errorbars[index])&&typeof prop.errorbars[index].capwidth==='number'){capwidth=prop.errorbars[index].capwidth;}
285
+ return capwidth;};if(typeof RG.SVG.tooltip!=='function'){RG.SVG.tooltip=function()
245
286
  {$a('The tooltip library has not been included!');};}})(window,document);window.$p=function(obj)
246
287
  {var indent=(arguments[2]?arguments[2]:' ');var str='';var counter=typeof arguments[3]=='number'?arguments[3]:0;if(counter>=5){return'';}
247
288
  switch(typeof obj){case'string':str+=obj+' ('+(typeof obj)+', '+obj.length+')';break;case'number':str+=obj+' ('+(typeof obj)+')';break;case'boolean':str+=obj+' ('+(typeof obj)+')';break;case'function':str+='function () {}';break;case'undefined':str+='undefined';break;case'null':str+='null';break;case'object':if(RGraph.SVG.isNull(obj)){str+=indent+'null\n';}else{str+=indent+'Object {'+'\n'