| OLD | NEW |
| 1 /* ² | 1 /* |
| 2 * ChartNew.js | 2 * ChartNew.js |
| 3 * | 3 * |
| 4 * Vancoppenolle Francois - January 2014 | 4 * Vancoppenolle Francois - January 2014 |
| 5 * francois.vancoppenolle@favomo.be | 5 * francois.vancoppenolle@favomo.be |
| 6 * | 6 * |
| 7 * Source location : http:\\www.favomo.be\graphjs | 7 * Source location : http:\\www.favomo.be\graphjs |
| 8 * GitHub community : https://github.com/FVANCOP/ChartNew.js | 8 * GitHub community : https://github.com/FVANCOP/ChartNew.js |
| 9 * | 9 * |
| 10 * This file is originally an adaptation of the chart.js source developped by Ni
ck Downie (2013) | 10 * This file is originally an adaptation of the chart.js source developped by Ni
ck Downie (2013) |
| 11 * https://github.com/nnnick/Chart.js. But since june 2014, Nick puts a new vers
ion with a | 11 * https://github.com/nnnick/Chart.js. But since june 2014, Nick puts a new vers
ion with a |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 211 } |
| 212 return window[fctName](parameter); | 212 return window[fctName](parameter); |
| 213 } | 213 } |
| 214 return; | 214 return; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 function isNumber(n) { | 217 function isNumber(n) { |
| 218 return !isNaN(parseFloat(n)) && isFinite(n); | 218 return !isNaN(parseFloat(n)) && isFinite(n); |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 function tmplbis(str, data) { | 221 function tmplbis(str, data,config) { |
| 222 » newstr=str; |
| 223 » if(newstr.substr(0,config.templatesOpenTag.length)==config.templatesOpen
Tag)newstr="<%="+newstr.substr(config.templatesOpenTag.length,newstr.length-conf
ig.templatesOpenTag.length); |
| 224 » if(newstr.substr(newstr.length-config.templatesCloseTag.length,config.te
mplatesCloseTag.length)==config.templatesCloseTag)newstr=newstr.substr(0,newstr.
length-config.templatesCloseTag.length)+"%>"; |
| 225 » return tmplter(newstr,data); |
| 226 } |
| 227 |
| 228 function tmplter(str, data) { |
| 222 var mathFunctionList = ["mean", "varianz", "stddev", "cv", "median"]; | 229 var mathFunctionList = ["mean", "varianz", "stddev", "cv", "median"]; |
| 223 var regexMath = new RegExp('<%=((?:(?:.*?)\\W)??)((?:' + mathFunctionLis
t.join('|') + ')(?:Dif)?)\\(([0-9]*?)\\)(.*?)%>', 'g'); | 230 var regexMath = new RegExp('<%=((?:(?:.*?)\\W)??)((?:' + mathFunctionLis
t.join('|') + ')(?:Dif)?)\\(([0-9]*?)\\)(.*?)%>', 'g'); |
| 224 while (regexMath.test(str)) { | 231 while (regexMath.test(str)) { |
| 225 str = str.replace(regexMath, function($0, $1, $2, $3, $4) { | 232 str = str.replace(regexMath, function($0, $1, $2, $3, $4) { |
| 226 if ($3) { | 233 if ($3) { |
| 227 var rndFac = $3; | 234 var rndFac = $3; |
| 228 } else { | 235 } else { |
| 229 var rndFac = 2; | 236 var rndFac = 2; |
| 230 } | 237 } |
| 231 var value = addParameters2Function(data, $2, "mathFuncti
ons"); | 238 var value = addParameters2Function(data, $2, "mathFuncti
ons"); |
| 232 if (isNumber(value)) { | 239 if (isNumber(value)) { |
| 233 return '<%=' + $1 + '' + Math.round(Math.pow(10,
rndFac) * value) / Math.pow(10, rndFac) + '' + $4 + '%>'; | 240 return '<%=' + $1 + '' + Math.round(Math.pow(10,
rndFac) * value) / Math.pow(10, rndFac) + '' + $4 + '%>'; |
| 234 } | 241 } |
| 235 return '<%= %>'; | 242 return '<%= %>'; |
| 236 }); | 243 }); |
| 237 } | 244 } |
| 238 // Figure out if we're getting a template, or if we need to | 245 // Figure out if we're getting a template, or if we need to |
| 239 // load the template - and be sure to cache the result. | 246 // load the template - and be sure to cache the result. |
| 240 // first check if it's can be an id | 247 // first check if it's can be an id |
| 241 var fn = /^[A-Za-z][-A-Za-z0-9_:.]*$/.test(str) ? cachebis[str] = cacheb
is[str] || | 248 var fn = /^[A-Za-z][-A-Za-z0-9_:.]*$/.test(str) ? cachebis[str] = cacheb
is[str] || |
| 242 » » tmplbis(document.getElementById(str).innerHTML) : | 249 » » tmplter(document.getElementById(str).innerHTML) : |
| 243 // Generate a reusable function that will serve as a template | 250 // Generate a reusable function that will serve as a template |
| 244 // generator (and which will be cached). | 251 // generator (and which will be cached). |
| 245 new Function("obj", | 252 new Function("obj", |
| 246 "var p=[],print=function(){p.push.apply(p,arguments);};"
+ | 253 "var p=[],print=function(){p.push.apply(p,arguments);};"
+ |
| 247 // Introduce the data as local variables using with(){} | 254 // Introduce the data as local variables using with(){} |
| 248 "with(obj){p.push('" + | 255 "with(obj){p.push('" + |
| 249 // Convert the template into pure JavaScript | 256 // Convert the template into pure JavaScript |
| 250 str | 257 str |
| 251 .replace(/[\r\n]/g, "\\n") | 258 .replace(/[\r\n]/g, "\\n") |
| 252 .replace(/[\t]/g, " ") | 259 .replace(/[\t]/g, " ") |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 if (canvas_pos.y < myStatData.midPosY) angle = -
angle; | 733 if (canvas_pos.y < myStatData.midPosY) angle = -
angle; |
| 727 angle = (((angle + 2 * Math.PI) % (2 * Math.PI)
) + 2* Math.PI) % (2* Math.PI) ; | 734 angle = (((angle + 2 * Math.PI) % (2 * Math.PI)
) + 2* Math.PI) % (2* Math.PI) ; |
| 728 myStatData.startAngle=(((myStatData.startAngle
+ 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI); | 735 myStatData.startAngle=(((myStatData.startAngle
+ 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI); |
| 729 myStatData.endAngle=(((myStatData.endAngle + 2
* Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI); | 736 myStatData.endAngle=(((myStatData.endAngle + 2
* Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI); |
| 730 if(myStatData.endAngle<myStatData.startAngle)myS
tatData.endAngle+=2 * Math.PI; | 737 if(myStatData.endAngle<myStatData.startAngle)myS
tatData.endAngle+=2 * Math.PI; |
| 731 if ((angle > myStatData.startAngle && angle < my
StatData.endAngle) || (angle > myStatData.startAngle - 2 * Math.PI && angle < my
StatData.endAngle - 2 * Math.PI) || (angle > myStatData.startAngle + 2 * Math.PI
&& angle < myStatData.endAngle + 2 * Math.PI)) { | 738 if ((angle > myStatData.startAngle && angle < my
StatData.endAngle) || (angle > myStatData.startAngle - 2 * Math.PI && angle < my
StatData.endAngle - 2 * Math.PI) || (angle > myStatData.startAngle + 2 * Math.PI
&& angle < myStatData.endAngle + 2 * Math.PI)) { |
| 732 myStatData.graphPosX = canvas_pos.x; | 739 myStatData.graphPosX = canvas_pos.x; |
| 733 myStatData.graphPosY = canvas_pos.y; | 740 myStatData.graphPosY = canvas_pos.y; |
| 734 onData = true; | 741 onData = true; |
| 735 if (action == "annotate") { | 742 if (action == "annotate") { |
| 736 » » » » » » dispString = tmplbis(setOptionVa
lue("ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,con
fig.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][12],-1,{otherVal:true}), my
StatData); | 743 » » » » » » dispString = tmplbis(setOptionVa
lue("ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,con
fig.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][12],-1,{otherVal:true}), my
StatData,config); |
| 737 annotateDIV.innerHTML = dispStri
ng; | 744 annotateDIV.innerHTML = dispStri
ng; |
| 738 show = true; | 745 show = true; |
| 739 } else { | 746 } else { |
| 740 funct(event, ctx, config, data,
myStatData ); | 747 funct(event, ctx, config, data,
myStatData ); |
| 741 } | 748 } |
| 742 if (action == "annotate") { | 749 if (action == "annotate") { |
| 743 x = bw.ns4 || bw.ns5 ? event.pag
eX : event.x; | 750 x = bw.ns4 || bw.ns5 ? event.pag
eX : event.x; |
| 744 y = bw.ns4 || bw.ns5 ? event.pag
eY : event.y; | 751 y = bw.ns4 || bw.ns5 ? event.pag
eY : event.y; |
| 745 if (bw.ie4 || bw.ie5) y = y + ev
al(scrolled); | 752 if (bw.ie4 || bw.ie5) y = y + ev
al(scrolled); |
| 746 oCursor.moveIt(x + fromLeft, y +
fromTop); | 753 oCursor.moveIt(x + fromLeft, y +
fromTop); |
| 747 } | 754 } |
| 748 } | 755 } |
| 749 } | 756 } |
| 750 } else if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "RECT") { | 757 } else if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "RECT") { |
| 751 myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraph
Annotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]]; | 758 myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraph
Annotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]]; |
| 752 | 759 |
| 753 if (canvas_pos.x > Math.min(myStatData.xPosLeft,myStatDa
ta.xPosRight) && canvas_pos.x < Math.max(myStatData.xPosLeft,myStatData.xPosRigh
t) && canvas_pos.y < Math.max(myStatData.yPosBottom,myStatData.yPosTop) && canva
s_pos.y > Math.min(myStatData.yPosBottom,myStatData.yPosTop)) { | 760 if (canvas_pos.x > Math.min(myStatData.xPosLeft,myStatDa
ta.xPosRight) && canvas_pos.x < Math.max(myStatData.xPosLeft,myStatData.xPosRigh
t) && canvas_pos.y < Math.max(myStatData.yPosBottom,myStatData.yPosTop) && canva
s_pos.y > Math.min(myStatData.yPosBottom,myStatData.yPosTop)) { |
| 754 myStatData.graphPosX = canvas_pos.x; | 761 myStatData.graphPosX = canvas_pos.x; |
| 755 myStatData.graphPosY = canvas_pos.y; | 762 myStatData.graphPosY = canvas_pos.y; |
| 756 onData = true; | 763 onData = true; |
| 757 if (action == "annotate") { | 764 if (action == "annotate") { |
| 758 » » » » » dispString = tmplbis(setOptionValue("ANN
OTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.anno
tateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][
i][2],{otherVal:true}), myStatData); | 765 » » » » » dispString = tmplbis(setOptionValue("ANN
OTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.anno
tateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][
i][2],{otherVal:true}), myStatData,config); |
| 759 annotateDIV.innerHTML = dispString; | 766 annotateDIV.innerHTML = dispString; |
| 760 show = true; | 767 show = true; |
| 761 } else { | 768 } else { |
| 762 funct(event, ctx, config, data, myStatDa
ta ); | 769 funct(event, ctx, config, data, myStatDa
ta ); |
| 763 } | 770 } |
| 764 if (action == "annotate") { | 771 if (action == "annotate") { |
| 765 x = bw.ns4 || bw.ns5 ? event.pageX : eve
nt.x; | 772 x = bw.ns4 || bw.ns5 ? event.pageX : eve
nt.x; |
| 766 y = bw.ns4 || bw.ns5 ? event.pageY : eve
nt.y; | 773 y = bw.ns4 || bw.ns5 ? event.pageY : eve
nt.y; |
| 767 if (bw.ie4 || bw.ie5) y = y + eval(scrol
led); | 774 if (bw.ie4 || bw.ie5) y = y + eval(scrol
led); |
| 768 oCursor.moveIt(x + fromLeft, y + fromTop
); | 775 oCursor.moveIt(x + fromLeft, y + fromTop
); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 789 } | 796 } |
| 790 | 797 |
| 791 } else { | 798 } else { |
| 792 distance = Math.sqrt((canvas_pos.x - myStatData.
posX) * (canvas_pos.x - myStatData.posX) + (canvas_pos.y - myStatData.posY) * (c
anvas_pos.y - myStatData.posY)); | 799 distance = Math.sqrt((canvas_pos.x - myStatData.
posX) * (canvas_pos.x - myStatData.posX) + (canvas_pos.y - myStatData.posY) * (c
anvas_pos.y - myStatData.posY)); |
| 793 } | 800 } |
| 794 if (distance < config.pointHitDetectionRadius) { | 801 if (distance < config.pointHitDetectionRadius) { |
| 795 myStatData.graphPosX = canvas_pos.x; | 802 myStatData.graphPosX = canvas_pos.x; |
| 796 myStatData.graphPosY = canvas_pos.y; | 803 myStatData.graphPosY = canvas_pos.y; |
| 797 onData = true; | 804 onData = true; |
| 798 if (action == "annotate") { | 805 if (action == "annotate") { |
| 799 » » » » » dispString = tmplbis(setOptionValue("ANN
OTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.anno
tateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][
i][2],{otherVal:true}), myStatData); | 806 » » » » » dispString = tmplbis(setOptionValue("ANN
OTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.anno
tateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][
i][2],{otherVal:true}), myStatData,config); |
| 800 annotateDIV.innerHTML = dispString; | 807 annotateDIV.innerHTML = dispString; |
| 801 show = true; | 808 show = true; |
| 802 } else { | 809 } else { |
| 803 funct(event, ctx, config, data, myStatDa
ta); | 810 funct(event, ctx, config, data, myStatDa
ta); |
| 804 } | 811 } |
| 805 if (action == "annotate") { | 812 if (action == "annotate") { |
| 806 x = bw.ns4 || bw.ns5 ? event.pageX : eve
nt.x; | 813 x = bw.ns4 || bw.ns5 ? event.pageX : eve
nt.x; |
| 807 y = bw.ns4 || bw.ns5 ? event.pageY : eve
nt.y; | 814 y = bw.ns4 || bw.ns5 ? event.pageY : eve
nt.y; |
| 808 if (bw.ie4 || bw.ie5) y = y + eval(scrol
led); | 815 if (bw.ie4 || bw.ie5) y = y + eval(scrol
led); |
| 809 oCursor.moveIt(x + fromLeft, y + fromTop
); | 816 oCursor.moveIt(x + fromLeft, y + fromTop
); |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 crossImagePosY: [0], | 1608 crossImagePosY: [0], |
| 1602 crossImageAngle: [0], | 1609 crossImageAngle: [0], |
| 1603 spaceTop: 0, | 1610 spaceTop: 0, |
| 1604 spaceBottom: 0, | 1611 spaceBottom: 0, |
| 1605 spaceRight: 0, | 1612 spaceRight: 0, |
| 1606 spaceLeft: 0, | 1613 spaceLeft: 0, |
| 1607 decimalSeparator: ".", | 1614 decimalSeparator: ".", |
| 1608 thousandSeparator: "", | 1615 thousandSeparator: "", |
| 1609 roundNumber: "none", | 1616 roundNumber: "none", |
| 1610 roundPct: -1, | 1617 roundPct: -1, |
| 1618 templatesOpenTag : "<%=", |
| 1619 templatesCloseTag : "%>", |
| 1611 fmtV1: "none", | 1620 fmtV1: "none", |
| 1612 fmtV2: "none", | 1621 fmtV2: "none", |
| 1613 fmtV3: "none", | 1622 fmtV3: "none", |
| 1614 fmtV4: "none", | 1623 fmtV4: "none", |
| 1615 fmtV5: "none", | 1624 fmtV5: "none", |
| 1616 fmtV6: "none", | 1625 fmtV6: "none", |
| 1626 fmtV6T: "none", |
| 1617 fmtV7: "none", | 1627 fmtV7: "none", |
| 1618 fmtV8: "none", | 1628 fmtV8: "none", |
| 1629 fmtV8T: "none", |
| 1619 fmtV9: "none", | 1630 fmtV9: "none", |
| 1620 fmtV10: "none", | 1631 fmtV10: "none", |
| 1621 fmtV11: "none", | 1632 fmtV11: "none", |
| 1622 fmtV12: "none", | 1633 fmtV12: "none", |
| 1623 fmtV13: "none", | 1634 fmtV13: "none", |
| 1624 fmtXLabel: "none", | 1635 fmtXLabel: "none", |
| 1625 fmtYLabel: "none", | 1636 fmtYLabel: "none", |
| 1626 fmtYLabel2: "none", | 1637 fmtYLabel2: "none", |
| 1627 fmtLegend: "none", | 1638 fmtLegend: "none", |
| 1628 animationStartValue: 0, | 1639 animationStartValue: 0, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 } else ctx.textAlign = setOption
Value("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-
1,{nullValue: true }); | 1849 } else ctx.textAlign = setOption
Value("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-
1,{nullValue: true }); |
| 1839 if (setOptionValue("INGRAPHDATAV
ALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : tr
ue} ) == "off-center") { | 1850 if (setOptionValue("INGRAPHDATAV
ALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : tr
ue} ) == "off-center") { |
| 1840 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; | 1851 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; |
| 1841 else ctx.textBaseline =
"bottom"; | 1852 else ctx.textBaseline =
"bottom"; |
| 1842 } else if (setOptionValue("INGRA
PHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullVal
ue : true} ) == "to-center") { | 1853 } else if (setOptionValue("INGRA
PHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullVal
ue : true} ) == "to-center") { |
| 1843 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; | 1854 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; |
| 1844 else ctx.textBaseline =
"top"; | 1855 else ctx.textBaseline =
"top"; |
| 1845 } else ctx.textBaseline = setOpt
ionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlig
n,i,-1,{nullValue : true} ); | 1856 } else ctx.textBaseline = setOpt
ionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlig
n,i,-1,{nullValue : true} ); |
| 1846 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); | 1857 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); |
| 1847 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
-1,{nullValue : true} ); | 1858 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
-1,{nullValue : true} ); |
| 1848 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i]); | 1859 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i],config); |
| 1849 ctx.translate(midPosX + labelRad
ius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle)); | 1860 ctx.translate(midPosX + labelRad
ius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle)); |
| 1850 if (setOptionValue("INGRAPHDATAR
OTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : tr
ue} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); | 1861 if (setOptionValue("INGRAPHDATAR
OTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : tr
ue} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); |
| 1851 else if (setOptionValue("INGRAPH
DATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue
: true} ) == "inRadiusAxisRotateLabels") { | 1862 else if (setOptionValue("INGRAPH
DATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue
: true} ) == "inRadiusAxisRotateLabels") { |
| 1852 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) <
3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); | 1863 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) <
3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); |
| 1853 else ctx.rotate(2 * Math
.PI - posAngle); | 1864 else ctx.rotate(2 * Math
.PI - posAngle); |
| 1854 } else ctx.rotate(setOptionValue
("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{
nullValue : true} ) * (Math.PI / 180)); | 1865 } else ctx.rotate(setOptionValue
("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{
nullValue : true} ) * (Math.PI / 180)); |
| 1855 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ), true); | 1866 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ), true); |
| 1856 ctx.restore(); | 1867 ctx.restore(); |
| 1857 } | 1868 } |
| 1858 } | 1869 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 if(statData[i][j].calcul
ated_offset>0) { | 2063 if(statData[i][j].calcul
ated_offset>0) { |
| 2053 ctx.translate(mi
dPosX + statData[i][j].offsetX * (radiusPrt/statData[i][j].calculated_offset), m
idPosY - statData[i][j].offsetY * (radiusPrt/statData[i][j].calculated_offset)); | 2064 ctx.translate(mi
dPosX + statData[i][j].offsetX * (radiusPrt/statData[i][j].calculated_offset), m
idPosY - statData[i][j].offsetY * (radiusPrt/statData[i][j].calculated_offset)); |
| 2054 } else { | 2065 } else { |
| 2055 ctx.translate(mi
dPosX, midPosY); | 2066 ctx.translate(mi
dPosX, midPosY); |
| 2056 } | 2067 } |
| 2057 if (setOptionValue("INGR
APHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullVa
lue : true} ) == "inRadiusAxis") ctx.rotate(j * rotationDegree); | 2068 if (setOptionValue("INGR
APHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullVa
lue : true} ) == "inRadiusAxis") ctx.rotate(j * rotationDegree); |
| 2058 else if (setOptionValue(
"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{n
ullValue : true} ) == "inRadiusAxisRotateLabels") { | 2069 else if (setOptionValue(
"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{n
ullValue : true} ) == "inRadiusAxisRotateLabels") { |
| 2059 if ((j * rotatio
nDegree + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (j * rotationDegree + 2
* Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) ctx.rotate(3 * Math.PI + j * rotat
ionDegree); | 2070 if ((j * rotatio
nDegree + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (j * rotationDegree + 2
* Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) ctx.rotate(3 * Math.PI + j * rotat
ionDegree); |
| 2060 else ctx.rotate(
2 * Math.PI + j * rotationDegree); | 2071 else ctx.rotate(
2 * Math.PI + j * rotationDegree); |
| 2061 } else ctx.rotate(setOpt
ionValue("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotat
e,i,-1,{nullValue : true} ) * (Math.PI / 180)); | 2072 } else ctx.rotate(setOpt
ionValue("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotat
e,i,-1,{nullValue : true} ) * (Math.PI / 180)); |
| 2062 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,-1,{nullValue : true} ), statData[i][j]); | 2073 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,-1,{nullValue : true} ), statData[i][j],config); |
| 2063 ctx.fillTextMultiLine(di
spString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); | 2074 ctx.fillTextMultiLine(di
spString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); |
| 2064 ctx.restore(); | 2075 ctx.restore(); |
| 2065 } | 2076 } |
| 2066 } | 2077 } |
| 2067 } | 2078 } |
| 2068 } | 2079 } |
| 2069 if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,dat
a,config,ctx,"Radar"); | 2080 if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,dat
a,config,ctx,"Radar"); |
| 2070 }; | 2081 }; |
| 2071 | 2082 |
| 2072 function drawScale() { | 2083 function drawScale() { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2321 } else ctx.textAlign = setOption
Value("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-
1,{nullValue: true }); | 2332 } else ctx.textAlign = setOption
Value("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-
1,{nullValue: true }); |
| 2322 if (setOptionValue("INGRAPHDATAV
ALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : tr
ue} ) == "off-center") { | 2333 if (setOptionValue("INGRAPHDATAV
ALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : tr
ue} ) == "off-center") { |
| 2323 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; | 2334 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; |
| 2324 else ctx.textBaseline =
"bottom"; | 2335 else ctx.textBaseline =
"bottom"; |
| 2325 } else if (setOptionValue("INGRA
PHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullVal
ue : true} ) == "to-center") { | 2336 } else if (setOptionValue("INGRA
PHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullVal
ue : true} ) == "to-center") { |
| 2326 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; | 2337 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; |
| 2327 else ctx.textBaseline =
"top"; | 2338 else ctx.textBaseline =
"top"; |
| 2328 } else ctx.textBaseline = setOpt
ionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlig
n,i,-1,{nullValue : true} ); | 2339 } else ctx.textBaseline = setOpt
ionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlig
n,i,-1,{nullValue : true} ); |
| 2329 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); | 2340 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); |
| 2330 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
-1,{nullValue : true} ); | 2341 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
-1,{nullValue : true} ); |
| 2331 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i]); | 2342 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i],config); |
| 2332 ctx.translate(midPieX + labelRad
ius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); | 2343 ctx.translate(midPieX + labelRad
ius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); |
| 2333 if (setOptionValue("INGRAPHDATAR
OTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : tr
ue} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); | 2344 if (setOptionValue("INGRAPHDATAR
OTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : tr
ue} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); |
| 2334 else if (setOptionValue("INGRAPH
DATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue
: true} ) == "inRadiusAxisRotateLabels") { | 2345 else if (setOptionValue("INGRAPH
DATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue
: true} ) == "inRadiusAxisRotateLabels") { |
| 2335 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) <
3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); | 2346 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) <
3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); |
| 2336 else ctx.rotate(2 * Math
.PI - posAngle); | 2347 else ctx.rotate(2 * Math
.PI - posAngle); |
| 2337 } else ctx.rotate(setOptionValue
("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{
nullValue : true} ) * (Math.PI / 180)); | 2348 } else ctx.rotate(setOptionValue
("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{
nullValue : true} ) * (Math.PI / 180)); |
| 2338 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); | 2349 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); |
| 2339 ctx.restore(); | 2350 ctx.restore(); |
| 2340 } | 2351 } |
| 2341 } | 2352 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2352 if (isBooleanOptionTrue(undefined,config.inGraphDataShow
) && setOptionValue("INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,conf
ig.inGraphDataRadiusPosition,0,-1,{nullValue : true} ) == 3 && setOptionValue("I
NGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,0,-1,{nullV
alue: true }) == "off-center" && setOptionValue("INGRAPHDATAROTATE",ctx,data,st
atData,undefined,config.inGraphDataRotate,0,-1,{nullValue : true} ) == 0) { | 2363 if (isBooleanOptionTrue(undefined,config.inGraphDataShow
) && setOptionValue("INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,conf
ig.inGraphDataRadiusPosition,0,-1,{nullValue : true} ) == 3 && setOptionValue("I
NGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,0,-1,{nullV
alue: true }) == "off-center" && setOptionValue("INGRAPHDATAROTATE",ctx,data,st
atData,undefined,config.inGraphDataRotate,0,-1,{nullValue : true} ) == 0) { |
| 2353 pieRadius = Min([msr.availableHeight / 2, msr.av
ailableWidth / 2]) - setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData,unde
fined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue("ING
RAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadi
us,0,-1,{nullValue: true} ) - 5; | 2364 pieRadius = Min([msr.availableHeight / 2, msr.av
ailableWidth / 2]) - setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData,unde
fined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue("ING
RAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadi
us,0,-1,{nullValue: true} ) - 5; |
| 2354 var realCumulativeAngle = ((config.startAngle *
(Math.PI / 180) + 2 * Math.PI) % (2*Math.PI) + 2*Math.PI) % (2*Math.PI); | 2365 var realCumulativeAngle = ((config.startAngle *
(Math.PI / 180) + 2 * Math.PI) % (2*Math.PI) + 2*Math.PI) % (2*Math.PI); |
| 2355 for (var i = 0; i < data.length; i++) { | 2366 for (var i = 0; i < data.length; i++) { |
| 2356 if (!(typeof(data[i].value) == 'undefine
d') && 1*data[i].value>=0) { | 2367 if (!(typeof(data[i].value) == 'undefine
d') && 1*data[i].value>=0) { |
| 2357 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); | 2368 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); |
| 2358 if (setOptionValue("INGRAPHDATAA
NGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{
nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue("INGRA
PHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,
-1,{nullValue: true }) * (Math.PI / 180); | 2369 if (setOptionValue("INGRAPHDATAA
NGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{
nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue("INGRA
PHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,
-1,{nullValue: true }) * (Math.PI / 180); |
| 2359 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segm
entAngle / 2 + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefin
ed,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); | 2370 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segm
entAngle / 2 + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefin
ed,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); |
| 2360 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segm
entAngle + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,c
onfig.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); | 2371 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segm
entAngle + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,c
onfig.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); |
| 2361 realCumulativeAngle -= statData[
i].segmentAngle; | 2372 realCumulativeAngle -= statData[
i].segmentAngle; |
| 2362 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i]); | 2373 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i],config); |
| 2363 var textMeasurement = ctx.measur
eText(dispString).width; | 2374 var textMeasurement = ctx.measur
eText(dispString).width; |
| 2364 var MaxRadiusX = Math.abs((msr.a
vailableWidth / 2 - textMeasurement) / Math.cos(posAngle)) - setOptionValue("ING
RAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadi
us,i,-1,{nullValue: true} ) - 5; | 2375 var MaxRadiusX = Math.abs((msr.a
vailableWidth / 2 - textMeasurement) / Math.cos(posAngle)) - setOptionValue("ING
RAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadi
us,i,-1,{nullValue: true} ) - 5; |
| 2365 if (MaxRadiusX < pieRadius) pieR
adius = MaxRadiusX; | 2376 if (MaxRadiusX < pieRadius) pieR
adius = MaxRadiusX; |
| 2366 } | 2377 } |
| 2367 } | 2378 } |
| 2368 } | 2379 } |
| 2369 pieRadius = pieRadius * config.radiusScale; | 2380 pieRadius = pieRadius * config.radiusScale; |
| 2370 }; | 2381 }; |
| 2371 }; | 2382 }; |
| 2372 var Doughnut = function(data, config, ctx) { | 2383 var Doughnut = function(data, config, ctx) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2459 } else ctx.textAlign = setOption
Value("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-
1,{nullValue: true }); | 2470 } else ctx.textAlign = setOption
Value("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-
1,{nullValue: true }); |
| 2460 if (setOptionValue("INGRAPHDATAV
ALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : tr
ue} ) == "off-center") { | 2471 if (setOptionValue("INGRAPHDATAV
ALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : tr
ue} ) == "off-center") { |
| 2461 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; | 2472 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; |
| 2462 else ctx.textBaseline =
"bottom"; | 2473 else ctx.textBaseline =
"bottom"; |
| 2463 } else if (setOptionValue("INGRA
PHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullVal
ue : true} ) == "to-center") { | 2474 } else if (setOptionValue("INGRA
PHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullVal
ue : true} ) == "to-center") { |
| 2464 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; | 2475 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; |
| 2465 else ctx.textBaseline =
"top"; | 2476 else ctx.textBaseline =
"top"; |
| 2466 } else ctx.textBaseline = setOpt
ionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlig
n,i,-1,{nullValue : true} ); | 2477 } else ctx.textBaseline = setOpt
ionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlig
n,i,-1,{nullValue : true} ); |
| 2467 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); | 2478 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); |
| 2468 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
-1,{nullValue : true} ); | 2479 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
-1,{nullValue : true} ); |
| 2469 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i]); | 2480 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i],config); |
| 2470 ctx.translate(midPieX + labelRad
ius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); | 2481 ctx.translate(midPieX + labelRad
ius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); |
| 2471 if (setOptionValue("INGRAPHDATAR
OTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : tr
ue} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); | 2482 if (setOptionValue("INGRAPHDATAR
OTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : tr
ue} ) == "inRadiusAxis") ctx.rotate(2 * Math.PI - posAngle); |
| 2472 else if (setOptionValue("INGRAPH
DATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue
: true} ) == "inRadiusAxisRotateLabels") { | 2483 else if (setOptionValue("INGRAPH
DATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue
: true} ) == "inRadiusAxisRotateLabels") { |
| 2473 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) <
3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); | 2484 if ((posAngle + 2 * Math
.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) <
3 * Math.PI / 2) ctx.rotate(3 * Math.PI - posAngle); |
| 2474 else ctx.rotate(2 * Math
.PI - posAngle); | 2485 else ctx.rotate(2 * Math
.PI - posAngle); |
| 2475 } else ctx.rotate(setOptionValue
("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{
nullValue : true} ) * (Math.PI / 180)); | 2486 } else ctx.rotate(setOptionValue
("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{
nullValue : true} ) * (Math.PI / 180)); |
| 2476 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); | 2487 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true); |
| 2477 ctx.restore(); | 2488 ctx.restore(); |
| 2478 } | 2489 } |
| 2479 } | 2490 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2490 doughnutRadius = Min([msr.availableHeight / 2, m
sr.availableWidth / 2]) - setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue
("INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddin
gRadius,0,-1,{nullValue: true} ) - 5; | 2501 doughnutRadius = Min([msr.availableHeight / 2, m
sr.availableWidth / 2]) - setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue
("INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddin
gRadius,0,-1,{nullValue: true} ) - 5; |
| 2491 var realCumulativeAngle = (((config.startAngle *
(Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; | 2502 var realCumulativeAngle = (((config.startAngle *
(Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; |
| 2492 var posAngle; | 2503 var posAngle; |
| 2493 for (var i = 0; i < data.length; i++) { | 2504 for (var i = 0; i < data.length; i++) { |
| 2494 if (!(typeof(data[i].value) == 'undefine
d') && 1*data[i].value>=0) { | 2505 if (!(typeof(data[i].value) == 'undefine
d') && 1*data[i].value>=0) { |
| 2495 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); | 2506 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{n
ullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statDat
a,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOp
tionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphData
FontFamily,i,-1,{nullValue : true} ); |
| 2496 if (setOptionValue("INGRAPHDATAA
NGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{
nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue("INGRA
PHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,
-1,{nullValue: true }) * (Math.PI / 180); | 2507 if (setOptionValue("INGRAPHDATAA
NGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{
nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue("INGRA
PHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,
-1,{nullValue: true }) * (Math.PI / 180); |
| 2497 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segm
entAngle / 2 + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefin
ed,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); | 2508 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segm
entAngle / 2 + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefin
ed,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); |
| 2498 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segm
entAngle + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,c
onfig.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); | 2509 else if (setOptionValue("INGRAPH
DATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i
,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segm
entAngle + setOptionValue("INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,c
onfig.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); |
| 2499 realCumulativeAngle -= statData[
i].segmentAngle; | 2510 realCumulativeAngle -= statData[
i].segmentAngle; |
| 2500 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i]); | 2511 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-
1,{nullValue : true} ), statData[i],config); |
| 2501 var textMeasurement = ctx.measur
eText(dispString).width; | 2512 var textMeasurement = ctx.measur
eText(dispString).width; |
| 2502 var MaxRadiusX = Math.abs((msr.a
vailableWidth / 2 - textMeasurement) / Math.cos(posAngle)) - setOptionValue("ING
RAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadi
us,i,-1,{nullValue: true} ) - 5; | 2513 var MaxRadiusX = Math.abs((msr.a
vailableWidth / 2 - textMeasurement) / Math.cos(posAngle)) - setOptionValue("ING
RAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadi
us,i,-1,{nullValue: true} ) - 5; |
| 2503 if (MaxRadiusX < doughnutRadius)
doughnutRadius = MaxRadiusX; | 2514 if (MaxRadiusX < doughnutRadius)
doughnutRadius = MaxRadiusX; |
| 2504 } | 2515 } |
| 2505 } | 2516 } |
| 2506 } | 2517 } |
| 2507 doughnutRadius = doughnutRadius * config.radiusScale; | 2518 doughnutRadius = doughnutRadius * config.radiusScale; |
| 2508 }; | 2519 }; |
| 2509 }; | 2520 }; |
| 2510 var Line = function(data, config, ctx) { | 2521 var Line = function(data, config, ctx) { |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 calculatedScale = { | 2909 calculatedScale = { |
| 2899 steps: scaleSteps, | 2910 steps: scaleSteps, |
| 2900 stepValue: scaleStepWidth, | 2911 stepValue: scaleStepWidth, |
| 2901 graphMin: scaleStartValue, | 2912 graphMin: scaleStartValue, |
| 2902 labels: [] | 2913 labels: [] |
| 2903 } | 2914 } |
| 2904 for (var i = 0; i <= calculatedScale.steps; i++)
{ | 2915 for (var i = 0; i <= calculatedScale.steps; i++)
{ |
| 2905 if (labelTemplateString) { | 2916 if (labelTemplateString) { |
| 2906 calculatedScale.labels.push(tmpl
(labelTemplateString, { | 2917 calculatedScale.labels.push(tmpl
(labelTemplateString, { |
| 2907 value: fmtChartJS(config
, 1 * ((scaleStartValue + (scaleStepWidth * i)).toFixed(getDecimalPlaces(scaleSt
epWidth))), config.fmtYLabel) | 2918 value: fmtChartJS(config
, 1 * ((scaleStartValue + (scaleStepWidth * i)).toFixed(getDecimalPlaces(scaleSt
epWidth))), config.fmtYLabel) |
| 2908 » » » » » » })); | 2919 » » » » » » },config)); |
| 2909 } | 2920 } |
| 2910 } | 2921 } |
| 2911 msr = setMeasures(data, config, ctx, height, wid
th, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); | 2922 msr = setMeasures(data, config, ctx, height, wid
th, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); |
| 2912 } | 2923 } |
| 2913 | 2924 |
| 2914 var prevHeight=msr.availableHeight; | 2925 var prevHeight=msr.availableHeight; |
| 2915 | 2926 |
| 2916 msr.availableHeight = msr.availableHeight - config.scale
TickSizeBottom - config.scaleTickSizeTop; | 2927 msr.availableHeight = msr.availableHeight - config.scale
TickSizeBottom - config.scaleTickSizeTop; |
| 2917 msr.availableWidth = msr.availableWidth - config.scaleTi
ckSizeLeft - config.scaleTickSizeRight; | 2928 msr.availableWidth = msr.availableWidth - config.scaleTi
ckSizeLeft - config.scaleTickSizeRight; |
| 2918 scaleHop = Math.floor(msr.availableHeight / calculatedSc
ale.steps); | 2929 scaleHop = Math.floor(msr.availableHeight / calculatedSc
ale.steps); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2981 if (typeof(data.datasets[i].data
[j]) == 'undefined') continue; | 2992 if (typeof(data.datasets[i].data
[j]) == 'undefined') continue; |
| 2982 if(setOptionValue("ANNOTATEDISPL
AY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true}))
{ | 2993 if(setOptionValue("ANNOTATEDISPL
AY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true}))
{ |
| 2983 jsGraphAnnotate[ctx.Char
tNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i, j, statData]; | 2994 jsGraphAnnotate[ctx.Char
tNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i, j, statData]; |
| 2984 } | 2995 } |
| 2985 if(setOptionValue("INGRAPHDATASH
OW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true}))
{ | 2996 if(setOptionValue("INGRAPHDATASH
OW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true}))
{ |
| 2986 ctx.save(); | 2997 ctx.save(); |
| 2987 ctx.textAlign = setOptio
nValue("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,
j,{nullValue: true }); | 2998 ctx.textAlign = setOptio
nValue("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,
j,{nullValue: true }); |
| 2988 ctx.textBaseline = setOp
tionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAli
gn,i,j,{nullValue : true} ); | 2999 ctx.textBaseline = setOp
tionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAli
gn,i,j,{nullValue : true} ); |
| 2989 ctx.font = setOptionValu
e("INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle
,i,j,{nullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' +
setOptionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGra
phDataFontFamily,i,j,{nullValue : true} ); | 3000 ctx.font = setOptionValu
e("INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle
,i,j,{nullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' +
setOptionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGra
phDataFontFamily,i,j,{nullValue : true} ); |
| 2990 ctx.fillStyle = setOptio
nValue("INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFont
Color,i,j,{nullValue : true} ); | 3001 ctx.fillStyle = setOptio
nValue("INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFont
Color,i,j,{nullValue : true} ); |
| 2991 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ), statData[i][j]); | 3002 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ), statData[i][j],config); |
| 2992 ctx.beginPath(); | 3003 ctx.beginPath(); |
| 2993 ctx.beginPath(); | 3004 ctx.beginPath(); |
| 2994 yPos = 0; | 3005 yPos = 0; |
| 2995 xPos = 0; | 3006 xPos = 0; |
| 2996 if (setOptionValue("INGR
APHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{n
ullValue : true} ) == 1) { | 3007 if (setOptionValue("INGR
APHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{n
ullValue : true} ) == 1) { |
| 2997 xPos = statData[
i][j].xPosLeft + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefine
d,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 3008 xPos = statData[
i][j].xPosLeft + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefine
d,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 2998 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 2) { | 3009 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 2) { |
| 2999 xPos = statData[
i][j].xPosLeft + barWidth / 2 + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,st
atData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 3010 xPos = statData[
i][j].xPosLeft + barWidth / 2 + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,st
atData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 3000 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 3) { | 3011 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 3) { |
| 3001 xPos = statData[
i][j].xPosLeft+ barWidth + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statDat
a,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 3012 xPos = statData[
i][j].xPosLeft+ barWidth + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statDat
a,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3236 calculatedScale = { | 3247 calculatedScale = { |
| 3237 steps: scaleSteps, | 3248 steps: scaleSteps, |
| 3238 stepValue: scaleStepWidth, | 3249 stepValue: scaleStepWidth, |
| 3239 graphMin: scaleStartValue, | 3250 graphMin: scaleStartValue, |
| 3240 labels: [] | 3251 labels: [] |
| 3241 } | 3252 } |
| 3242 for (var i = 0; i <= calculatedScale.steps; i++)
{ | 3253 for (var i = 0; i <= calculatedScale.steps; i++)
{ |
| 3243 if (labelTemplateString) { | 3254 if (labelTemplateString) { |
| 3244 calculatedScale.labels.push(tmpl
(labelTemplateString, { | 3255 calculatedScale.labels.push(tmpl
(labelTemplateString, { |
| 3245 value: fmtChartJS(config
, 1 * ((scaleStartValue + (scaleStepWidth * i)).toFixed(getDecimalPlaces(scaleSt
epWidth))), config.fmtYLabel) | 3256 value: fmtChartJS(config
, 1 * ((scaleStartValue + (scaleStepWidth * i)).toFixed(getDecimalPlaces(scaleSt
epWidth))), config.fmtYLabel) |
| 3246 » » » » » » })); | 3257 » » » » » » },config)); |
| 3247 } | 3258 } |
| 3248 } | 3259 } |
| 3249 msr = setMeasures(data, config, ctx, height, wid
th, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStack
edBar"); | 3260 msr = setMeasures(data, config, ctx, height, wid
th, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStack
edBar"); |
| 3250 } | 3261 } |
| 3251 msr.availableHeight = msr.availableHeight - config.scale
TickSizeBottom - config.scaleTickSizeTop; | 3262 msr.availableHeight = msr.availableHeight - config.scale
TickSizeBottom - config.scaleTickSizeTop; |
| 3252 msr.availableWidth = msr.availableWidth - config.scaleTi
ckSizeLeft - config.scaleTickSizeRight; | 3263 msr.availableWidth = msr.availableWidth - config.scaleTi
ckSizeLeft - config.scaleTickSizeRight; |
| 3253 scaleHop = Math.floor(msr.availableHeight / data.labels.
length); | 3264 scaleHop = Math.floor(msr.availableHeight / data.labels.
length); |
| 3254 valueHop = Math.floor(msr.availableWidth / (calculatedSc
ale.steps)); | 3265 valueHop = Math.floor(msr.availableWidth / (calculatedSc
ale.steps)); |
| 3255 if (valueHop == 0 || config.fullWidthGraph) valueHop = (
msr.availableWidth / (calculatedScale.steps)); | 3266 if (valueHop == 0 || config.fullWidthGraph) valueHop = (
msr.availableWidth / (calculatedScale.steps)); |
| 3256 msr.clrwidth = msr.clrwidth - (msr.availableWidth - (cal
culatedScale.steps * valueHop)); | 3267 msr.clrwidth = msr.clrwidth - (msr.availableWidth - (cal
culatedScale.steps * valueHop)); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3324 if ((typeof(data.datasets[i].dat
a[j]) == 'undefined')) continue; | 3335 if ((typeof(data.datasets[i].dat
a[j]) == 'undefined')) continue; |
| 3325 if (setOptionValue("ANNOTATEDISP
LAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true}))
{ | 3336 if (setOptionValue("ANNOTATEDISP
LAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true}))
{ |
| 3326 jsGraphAnnotate[ctx.Char
tNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j, statData]; | 3337 jsGraphAnnotate[ctx.Char
tNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j, statData]; |
| 3327 } | 3338 } |
| 3328 if(setOptionValue("INGRAPHDATASH
OW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true}))
{ | 3339 if(setOptionValue("INGRAPHDATASH
OW",ctx,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true}))
{ |
| 3329 ctx.save(); | 3340 ctx.save(); |
| 3330 ctx.textAlign = setOptio
nValue("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,
j,{nullValue: true }); | 3341 ctx.textAlign = setOptio
nValue("INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,
j,{nullValue: true }); |
| 3331 ctx.textBaseline = setOp
tionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAli
gn,i,j,{nullValue : true} ); | 3342 ctx.textBaseline = setOp
tionValue("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAli
gn,i,j,{nullValue : true} ); |
| 3332 ctx.font = setOptionValu
e("INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle
,i,j,{nullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' +
setOptionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGra
phDataFontFamily,i,j,{nullValue : true} ); | 3343 ctx.font = setOptionValu
e("INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle
,i,j,{nullValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' +
setOptionValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGra
phDataFontFamily,i,j,{nullValue : true} ); |
| 3333 ctx.fillStyle = setOptio
nValue("INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFont
Color,i,j,{nullValue : true} ); | 3344 ctx.fillStyle = setOptio
nValue("INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFont
Color,i,j,{nullValue : true} ); |
| 3334 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ),statData[i][j]); | 3345 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ),statData[i][j],config); |
| 3335 ctx.beginPath(); | 3346 ctx.beginPath(); |
| 3336 yPos = 0; | 3347 yPos = 0; |
| 3337 xPos = 0; | 3348 xPos = 0; |
| 3338 if (setOptionValue("INGR
APHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{n
ullValue : true} ) == 1) { | 3349 if (setOptionValue("INGR
APHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{n
ullValue : true} ) == 1) { |
| 3339 xPos = statData[
i][j].xPosLeft + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefine
d,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 3350 xPos = statData[
i][j].xPosLeft + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefine
d,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 3340 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 2) { | 3351 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 2) { |
| 3341 xPos = statData[
i][j].xPosLeft + (statData[i][j].xPosRight-statData[i][j].xPosLeft)/2 + setOptio
nValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddi
ngX,i,j,{nullValue : true} ); | 3352 xPos = statData[
i][j].xPosLeft + (statData[i][j].xPosRight-statData[i][j].xPosLeft)/2 + setOptio
nValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddi
ngX,i,j,{nullValue : true} ); |
| 3342 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 3) { | 3353 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 3) { |
| 3343 xPos = statData[
i][j].xPosRight + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefin
ed,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 3354 xPos = statData[
i][j].xPosRight + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefin
ed,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 3344 } | 3355 } |
| 3345 if (setOptionValue("INGR
APHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{n
ullValue : true} ) == 1) { | 3356 if (setOptionValue("INGR
APHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{n
ullValue : true} ) == 1) { |
| 3346 yPos = statData[
i][j].yPosBottom - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefi
ned,config.inGraphDataPaddingY,i,j,{nullValue : true} ); | 3357 yPos = statData[
i][j].yPosBottom - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefi
ned,config.inGraphDataPaddingY,i,j,{nullValue : true} ); |
| 3347 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 2) { | 3358 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 2) { |
| 3348 yPos = statData[
i][j].yPosBottom - barWidth / 2 - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,
statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); | 3359 yPos = statData[
i][j].yPosBottom - barWidth / 2 - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,
statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); |
| 3349 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 3) { | 3360 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 3) { |
| 3350 yPos = statData[
i][j].yPosTop - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefined
,config.inGraphDataPaddingY,i,j,{nullValue : true} ); | 3361 yPos = statData[
i][j].yPosTop - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefined
,config.inGraphDataPaddingY,i,j,{nullValue : true} ); |
| 3351 } | 3362 } |
| 3352 » » » » » » » if(xPos<=msr.availableWi
dth+msr.leftNotUsableSize) { | 3363 //» » » » » » » » if(xPos<=msr.ava
ilableWidth+msr.leftNotUsableSize) { |
| 3353 ctx.translate(xP
os, yPos); | 3364 ctx.translate(xP
os, yPos); |
| 3354 ctx.rotate(setOp
tionValue("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRota
te,i,j,{nullValue : true} ) * (Math.PI / 180)); | 3365 ctx.rotate(setOp
tionValue("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRota
te,i,j,{nullValue : true} ) * (Math.PI / 180)); |
| 3355 ctx.fillTextMult
iLine(dispString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",c
tx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),t
rue); | 3366 ctx.fillTextMult
iLine(dispString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",c
tx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),t
rue); |
| 3356 ctx.restore(); | 3367 ctx.restore(); |
| 3357 » » » » » » » } | 3368 //» » » » » » » } |
| 3358 } | 3369 } |
| 3359 } | 3370 } |
| 3360 } | 3371 } |
| 3361 } | 3372 } |
| 3362 if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,dat
a,config,ctx,"HorizontalStackedBar"); | 3373 if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,dat
a,config,ctx,"HorizontalStackedBar"); |
| 3363 }; | 3374 }; |
| 3364 | 3375 |
| 3365 function drawScale() { | 3376 function drawScale() { |
| 3366 //X axis line
| 3377 //X axis line
|
| 3367 ctx.lineWidth = config.scaleLineWidth; | 3378 ctx.lineWidth = config.scaleLineWidth; |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3718 xPos = statData[
i][j].xPosLeft + barWidth + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statDa
ta,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 3729 xPos = statData[
i][j].xPosLeft + barWidth + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statDa
ta,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 3719 } | 3730 } |
| 3720 if (setOptionValue("INGR
APHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{n
ullValue : true} ) == 1) { | 3731 if (setOptionValue("INGR
APHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{n
ullValue : true} ) == 1) { |
| 3721 yPos = statData[
i][j].yPosBottom - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefi
ned,config.inGraphDataPaddingY,i,j,{nullValue : true} ); | 3732 yPos = statData[
i][j].yPosBottom - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefi
ned,config.inGraphDataPaddingY,i,j,{nullValue : true} ); |
| 3722 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 2) { | 3733 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 2) { |
| 3723 yPos = (statData
[i][j].yPosBottom+statData[i][j].yPosTop)/2 - setOptionValue("INGRAPHDATAPADDING
Y",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true}
); | 3734 yPos = (statData
[i][j].yPosBottom+statData[i][j].yPosTop)/2 - setOptionValue("INGRAPHDATAPADDING
Y",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true}
); |
| 3724 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 3) { | 3735 } else if (setOptionValu
e("INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition
,i,j,{nullValue : true} ) == 3) { |
| 3725 yPos = statData[
i][j].yPosTop - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefined
,config.inGraphDataPaddingY,i,j,{nullValue : true} ); | 3736 yPos = statData[
i][j].yPosTop - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefined
,config.inGraphDataPaddingY,i,j,{nullValue : true} ); |
| 3726 } | 3737 } |
| 3727 ctx.translate(xPos, yPos
); | 3738 ctx.translate(xPos, yPos
); |
| 3728 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ), statData[i][j]); | 3739 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ), statData[i][j],config); |
| 3729 ctx.rotate(setOptionValu
e("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{
nullValue : true} ) * (Math.PI / 180)); | 3740 ctx.rotate(setOptionValu
e("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{
nullValue : true} ) * (Math.PI / 180)); |
| 3730 ctx.fillTextMultiLine(di
spString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); | 3741 ctx.fillTextMultiLine(di
spString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); |
| 3731 ctx.restore(); | 3742 ctx.restore(); |
| 3732 } | 3743 } |
| 3733 } | 3744 } |
| 3734 } | 3745 } |
| 3735 } | 3746 } |
| 3736 if (animPc >= 1 && typeof drawMath == "function") { | 3747 if (animPc >= 1 && typeof drawMath == "function") { |
| 3737 drawMath(ctx, config, data, msr, { | 3748 drawMath(ctx, config, data, msr, { |
| 3738 xAxisPosY: xAxisPosY, | 3749 xAxisPosY: xAxisPosY, |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4067 yPos = statData[
i][j].yPosTop - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefined
,config.inGraphDataPaddingY,i,j,{nullValue : true} ); | 4078 yPos = statData[
i][j].yPosTop - setOptionValue("INGRAPHDATAPADDINGY",ctx,data,statData,undefined
,config.inGraphDataPaddingY,i,j,{nullValue : true} ); |
| 4068 } | 4079 } |
| 4069 if (setOptionValue("INGR
APHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{n
ullValue : true} ) == 1) { | 4080 if (setOptionValue("INGR
APHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{n
ullValue : true} ) == 1) { |
| 4070 xPos = statData[
i][j].xPosLeft + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefine
d,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 4081 xPos = statData[
i][j].xPosLeft + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefine
d,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 4071 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 2) { | 4082 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 2) { |
| 4072 xPos = (statData
[i][j].xPosLeft+statData[i][j].xPosRight)/2 + setOptionValue("INGRAPHDATAPADDING
X",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true}
); | 4083 xPos = (statData
[i][j].xPosLeft+statData[i][j].xPosRight)/2 + setOptionValue("INGRAPHDATAPADDING
X",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true}
); |
| 4073 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 3) { | 4084 } else if (setOptionValu
e("INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition
,i,j,{nullValue : true} ) == 3) { |
| 4074 xPos = statData[
i][j].xPosRight + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefin
ed,config.inGraphDataPaddingX,i,j,{nullValue : true} ); | 4085 xPos = statData[
i][j].xPosRight + setOptionValue("INGRAPHDATAPADDINGX",ctx,data,statData,undefin
ed,config.inGraphDataPaddingX,i,j,{nullValue : true} ); |
| 4075 } | 4086 } |
| 4076 ctx.translate(xPos, yPos
); | 4087 ctx.translate(xPos, yPos
); |
| 4077 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ), statData[i][j]); | 4088 » » » » » » » var dispString = tmplbis
(setOptionValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphData
Tmpl,i,j,{nullValue : true} ), statData[i][j],config); |
| 4078 ctx.rotate(setOptionValu
e("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{
nullValue : true} ) * (Math.PI / 180)); | 4089 ctx.rotate(setOptionValu
e("INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{
nullValue : true} ) * (Math.PI / 180)); |
| 4079 ctx.fillTextMultiLine(di
spString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); | 4090 ctx.fillTextMultiLine(di
spString, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,
statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); |
| 4080 ctx.restore(); | 4091 ctx.restore(); |
| 4081 } | 4092 } |
| 4082 } | 4093 } |
| 4083 } | 4094 } |
| 4084 } | 4095 } |
| 4085 if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,dat
a,config,ctx,"HorizontalBar"); | 4096 if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,dat
a,config,ctx,"HorizontalBar"); |
| 4086 }; | 4097 }; |
| 4087 | 4098 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4446 } else { | 4457 } else { |
| 4447 logarithmic = config.logarithmic; | 4458 logarithmic = config.logarithmic; |
| 4448 fmtYLabel = config.fmtYLabel; | 4459 fmtYLabel = config.fmtYLabel; |
| 4449 } | 4460 } |
| 4450 if (labelTemplateString) { | 4461 if (labelTemplateString) { |
| 4451 //Fix floating point errors by setting to fixed the on t
he same decimal as the stepValue. | 4462 //Fix floating point errors by setting to fixed the on t
he same decimal as the stepValue. |
| 4452 if (!logarithmic) { // no logarithmic scale | 4463 if (!logarithmic) { // no logarithmic scale |
| 4453 for (var i = 0; i < numberOfSteps + 1; i++) { | 4464 for (var i = 0; i < numberOfSteps + 1; i++) { |
| 4454 labels.push(tmpl(labelTemplateString, { | 4465 labels.push(tmpl(labelTemplateString, { |
| 4455 value: fmtChartJS(config, 1 * ((
graphMin + (stepValue * i)).toFixed(getDecimalPlaces(stepValue))), fmtYLabel) | 4466 value: fmtChartJS(config, 1 * ((
graphMin + (stepValue * i)).toFixed(getDecimalPlaces(stepValue))), fmtYLabel) |
| 4456 » » » » » })); | 4467 » » » » » },config)); |
| 4457 } | 4468 } |
| 4458 } else { // logarithmic scale 10,100,1000,... | 4469 } else { // logarithmic scale 10,100,1000,... |
| 4459 var value = graphMin; | 4470 var value = graphMin; |
| 4460 for (var i = 0; i < numberOfSteps + 1; i++) { | 4471 for (var i = 0; i < numberOfSteps + 1; i++) { |
| 4461 labels.push(tmpl(labelTemplateString, { | 4472 labels.push(tmpl(labelTemplateString, { |
| 4462 value: fmtChartJS(config, 1 * va
lue.toFixed(getDecimalPlaces(value)), fmtYLabel) | 4473 value: fmtChartJS(config, 1 * va
lue.toFixed(getDecimalPlaces(value)), fmtYLabel) |
| 4463 » » » » » })); | 4474 » » » » » },config)); |
| 4464 value *= 10; | 4475 value *= 10; |
| 4465 } | 4476 } |
| 4466 } | 4477 } |
| 4467 } | 4478 } |
| 4468 }; | 4479 }; |
| 4469 //Max value from array | 4480 //Max value from array |
| 4470 function Max(array) { | 4481 function Max(array) { |
| 4471 return Math.max.apply(Math, array); | 4482 return Math.max.apply(Math, array); |
| 4472 }; | 4483 }; |
| 4473 //Min value from array | 4484 //Min value from array |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4513 for (var attrname in defaults) { | 4524 for (var attrname in defaults) { |
| 4514 returnObj[attrname] = defaults[attrname]; | 4525 returnObj[attrname] = defaults[attrname]; |
| 4515 } | 4526 } |
| 4516 for (var attrname in userDefined) { | 4527 for (var attrname in userDefined) { |
| 4517 returnObj[attrname] = userDefined[attrname]; | 4528 returnObj[attrname] = userDefined[attrname]; |
| 4518 } | 4529 } |
| 4519 return returnObj; | 4530 return returnObj; |
| 4520 }; | 4531 }; |
| 4521 //Javascript micro templating by John Resig - source at http://ejohn.org
/blog/javascript-micro-templating/ | 4532 //Javascript micro templating by John Resig - source at http://ejohn.org
/blog/javascript-micro-templating/ |
| 4522 var cache = {}; | 4533 var cache = {}; |
| 4534 |
| 4535 function tmpl(str, data,config) { |
| 4536 newstr=str; |
| 4537 if(newstr.substr(0,config.templatesOpenTag.length)==config.templ
atesOpenTag)newstr="<%="+newstr.substr(config.templatesOpenTag.length,newstr.len
gth-config.templatesOpenTag.length); |
| 4538 if(newstr.substr(newstr.length-config.templatesCloseTag.length,c
onfig.templatesCloseTag.length)==config.templatesCloseTag)newstr=newstr.substr(0
,newstr.length-config.templatesCloseTag.length)+"%>"; |
| 4539 return tmplpart2(newstr,data); |
| 4540 } |
| 4523 | 4541 |
| 4524 » function tmpl(str, data) { | 4542 » function tmplpart2(str, data) { |
| 4525 // Figure out if we're getting a template, or if we need to | 4543 // Figure out if we're getting a template, or if we need to |
| 4526 // load the template - and be sure to cache the result. | 4544 // load the template - and be sure to cache the result. |
| 4527 var fn = !/\W/.test(str) ? | 4545 var fn = !/\W/.test(str) ? |
| 4528 cache[str] = cache[str] || | 4546 cache[str] = cache[str] || |
| 4529 » » » tmpl(document.getElementById(str).innerHTML) : | 4547 » » » tmplpart2(document.getElementById(str).innerHTML) : |
| 4530 // Generate a reusable function that will serve as a tem
plate | 4548 // Generate a reusable function that will serve as a tem
plate |
| 4531 // generator (and which will be cached). | 4549 // generator (and which will be cached). |
| 4532 new Function("obj", | 4550 new Function("obj", |
| 4533 "var p=[],print=function(){p.push.apply(p,argume
nts);};" + | 4551 "var p=[],print=function(){p.push.apply(p,argume
nts);};" + |
| 4534 // Introduce the data as local variables using w
ith(){} | 4552 // Introduce the data as local variables using w
ith(){} |
| 4535 "with(obj){p.push('" + | 4553 "with(obj){p.push('" + |
| 4536 // Convert the template into pure JavaScript | 4554 // Convert the template into pure JavaScript |
| 4537 str | 4555 str |
| 4538 .replace(/[\r\t\n]/g, " ") | 4556 .replace(/[\r\t\n]/g, " ") |
| 4539 .split("<%").join("\t") | 4557 .split("<%").join("\t") |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5451 jsGraphAnnotate[ctx.ChartNewId][
jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData]; | 5469 jsGraphAnnotate[ctx.ChartNewId][
jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData]; |
| 5452 } | 5470 } |
| 5453 if (setOptionValue("INGRAPHDATASHOW",ctx
,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { | 5471 if (setOptionValue("INGRAPHDATASHOW",ctx
,data,statData,undefined,config.inGraphDataShow,i,j,{nullValue : true})) { |
| 5454 ctx.save(); | 5472 ctx.save(); |
| 5455 ctx.textAlign = setOptionValue("
INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullV
alue: true }); | 5473 ctx.textAlign = setOptionValue("
INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullV
alue: true }); |
| 5456 ctx.textBaseline = setOptionValu
e("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{
nullValue : true} ); | 5474 ctx.textBaseline = setOptionValu
e("INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{
nullValue : true} ); |
| 5457 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nu
llValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOpti
onValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFo
ntFamily,i,j,{nullValue : true} ); | 5475 ctx.font = setOptionValue("INGRA
PHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nu
llValue : true} ) + ' ' + setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOpti
onValue("INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFo
ntFamily,i,j,{nullValue : true} ); |
| 5458 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
j,{nullValue : true} ); | 5476 ctx.fillStyle = setOptionValue("
INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,
j,{nullValue : true} ); |
| 5459 var paddingTextX = setOptionValu
e("INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i
,j,{nullValue : true} ), | 5477 var paddingTextX = setOptionValu
e("INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i
,j,{nullValue : true} ), |
| 5460 paddingTextY = setOption
Value("INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddin
gY,i,j,{nullValue : true} ); | 5478 paddingTextY = setOption
Value("INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddin
gY,i,j,{nullValue : true} ); |
| 5461 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j
,{nullValue : true} ), statData[i][j]); | 5479 » » » » » » var dispString = tmplbis(setOpti
onValue("INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j
,{nullValue : true} ), statData[i][j],config); |
| 5462 ctx.translate(statData[i][j].xPo
s + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][
j].yPosOffset - paddingTextY); | 5480 ctx.translate(statData[i][j].xPo
s + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][
j].yPosOffset - paddingTextY); |
| 5463 ctx.rotate(setOptionValue("INGRA
PHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValu
e : true} ) * (Math.PI / 180)); | 5481 ctx.rotate(setOptionValue("INGRA
PHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValu
e : true} ) * (Math.PI / 180)); |
| 5464 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); | 5482 ctx.fillTextMultiLine(dispString
, 0, 0, ctx.textBaseline, setOptionValue("INGRAPHDATAFONTSIZE",ctx,data,statData
,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true); |
| 5465 ctx.restore(); | 5483 ctx.restore(); |
| 5466 } | 5484 } |
| 5467 } | 5485 } |
| 5468 } | 5486 } |
| 5469 }; | 5487 }; |
| 5470 | 5488 |
| 5471 | 5489 |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6017 lminvalue[0]=[]; | 6035 lminvalue[0]=[]; |
| 6018 lminvalue[1]=[]; | 6036 lminvalue[1]=[]; |
| 6019 var lgtxt,lgtxt2,tp; | 6037 var lgtxt,lgtxt2,tp; |
| 6020 var prevpos=[]; | 6038 var prevpos=[]; |
| 6021 var firstNotMissingi=[]; | 6039 var firstNotMissingi=[]; |
| 6022 var lastNotMissingi=[]; | 6040 var lastNotMissingi=[]; |
| 6023 var firstNotMissingj=[]; | 6041 var firstNotMissingj=[]; |
| 6024 var lastNotMissingj=[]; | 6042 var lastNotMissingj=[]; |
| 6025 prevpos[0]=[]; | 6043 prevpos[0]=[]; |
| 6026 prevpos[1]=[]; | 6044 prevpos[1]=[]; |
| 6045 var grandtotal=0; |
| 6027 for (var i = 0; i < data.datasets.length; i++) { | 6046 for (var i = 0; i < data.datasets.length; i++) { |
| 6028 // BUG when all data are missing ! | 6047 // BUG when all data are missing ! |
| 6029 if (typeof data.datasets[i].xPos != "undefined" && tpdra
w(ctx,data.datasets[i])=="Line") { | 6048 if (typeof data.datasets[i].xPos != "undefined" && tpdra
w(ctx,data.datasets[i])=="Line") { |
| 6030 for(var j=data.datasets[i].data.length;j<data.da
tasets[i].xPos.length;j++)data.datasets[i].data.push(undefined); | 6049 for(var j=data.datasets[i].data.length;j<data.da
tasets[i].xPos.length;j++)data.datasets[i].data.push(undefined); |
| 6031 } else { | 6050 } else { |
| 6032 for(var j=data.datasets[i].data.length;j<data.la
bels.length;j++)data.datasets[i].data.push(undefined); | 6051 for(var j=data.datasets[i].data.length;j<data.la
bels.length;j++)data.datasets[i].data.push(undefined); |
| 6033 } | 6052 } |
| 6034 | 6053 |
| 6035 | 6054 |
| 6036 if(data.datasets[i].axis == 2) axis=0;else axis=1; | 6055 if(data.datasets[i].axis == 2) axis=0;else axis=1; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 6047 firstNotMissingj[j]=-1; | 6066 firstNotMissingj[j]=-1; |
| 6048 lastNotMissingj[j]=-1; | 6067 lastNotMissingj[j]=-1; |
| 6049 totvalue[0][j] = 0; | 6068 totvalue[0][j] = 0; |
| 6050 mxvalue[0][j]=-Number.MAX_VALUE; | 6069 mxvalue[0][j]=-Number.MAX_VALUE; |
| 6051 mnvalue[0][j]=Number.MAX_VALUE; | 6070 mnvalue[0][j]=Number.MAX_VALUE; |
| 6052 totvalue[1][j] = 0; | 6071 totvalue[1][j] = 0; |
| 6053 mxvalue[1][j]=-Number.MAX_VALUE; | 6072 mxvalue[1][j]=-Number.MAX_VALUE; |
| 6054 mnvalue[1][j]=Number.MAX_VALUE; | 6073 mnvalue[1][j]=Number.MAX_VALUE; |
| 6055 } | 6074 } |
| 6056 if (!(typeof data.datasets[i].data[j] == 'undefi
ned')) { | 6075 if (!(typeof data.datasets[i].data[j] == 'undefi
ned')) { |
| 6076 grandtotal += 1 * data.datasets[i].data[
j]; |
| 6057 if(firstNotMissingi[i]==-1)firstNotMissi
ngi[i]=j; | 6077 if(firstNotMissingi[i]==-1)firstNotMissi
ngi[i]=j; |
| 6058 lastNotMissingi[i]=j; | 6078 lastNotMissingi[i]=j; |
| 6059 if(firstNotMissingj[j]==-1)firstNotMissi
ngj[j]=i; | 6079 if(firstNotMissingj[j]==-1)firstNotMissi
ngj[j]=i; |
| 6060 lastNotMissingj[j]=i; | 6080 lastNotMissingj[j]=i; |
| 6061 totvalue[axis][j] += 1 * data.datasets[i
].data[j]; | 6081 totvalue[axis][j] += 1 * data.datasets[i
].data[j]; |
| 6062 mxvalue[axis][j] =Math.max(mxvalue[axis]
[j],1 * data.datasets[i].data[j]); | 6082 mxvalue[axis][j] =Math.max(mxvalue[axis]
[j],1 * data.datasets[i].data[j]); |
| 6063 mnvalue[axis][j] =Math.min(mnvalue[axis]
[j],1 * data.datasets[i].data[j]); | 6083 mnvalue[axis][j] =Math.min(mnvalue[axis]
[j],1 * data.datasets[i].data[j]); |
| 6064 lmaxvalue[axis][i] =Math.max(lmaxvalue[a
xis][i],1 * data.datasets[i].data[j]); | 6084 lmaxvalue[axis][i] =Math.max(lmaxvalue[a
xis][i],1 * data.datasets[i].data[j]); |
| 6065 lminvalue[axis][i] =Math.min(lminvalue[a
xis][i],1 * data.datasets[i].data[j]); | 6085 lminvalue[axis][i] =Math.min(lminvalue[a
xis][i],1 * data.datasets[i].data[j]); |
| 6066 } | 6086 } |
| 6067 } | 6087 } |
| 6068 } | 6088 } |
| 6069 | 6089 |
| 6070 for (var i = 0; i < data.datasets.length; i++) { | 6090 for (var i = 0; i < data.datasets.length; i++) { |
| 6071 if(data.datasets[i].axis == 2) axis=0;else axis=1; | 6091 if(data.datasets[i].axis == 2) axis=0;else axis=1; |
| 6072 if (typeof(data.datasets[i].title) == "string") lgtxt =
data.datasets[i].title.trim(); | 6092 if (typeof(data.datasets[i].title) == "string") lgtxt =
data.datasets[i].title.trim(); |
| 6073 else lgtxt = ""; | 6093 else lgtxt = ""; |
| 6074 var prevnotemptyj=-1; | 6094 var prevnotemptyj=-1; |
| 6075 var prevemptyj=-1; | 6095 var prevemptyj=-1; |
| 6076 for (var j = 0; j < data.datasets[i].data.length; j++) { | 6096 for (var j = 0; j < data.datasets[i].data.length; j++) { |
| 6077 | 6097 |
| 6078 if(typeof cumvalue[0][j]== "undefined"){cumvalue
[0][j] = 0; prevpos[0][j]=-1;cumvalue[1][j] = 0; prevpos[1][j]=-1; } | 6098 if(typeof cumvalue[0][j]== "undefined"){cumvalue
[0][j] = 0; prevpos[0][j]=-1;cumvalue[1][j] = 0; prevpos[1][j]=-1; } |
| 6079 lgtxt2 = ""; | 6099 lgtxt2 = ""; |
| 6080 if (typeof data.datasets[i].xPos != "undefined")
{ | 6100 if (typeof data.datasets[i].xPos != "undefined")
{ |
| 6081 if (!(typeof data.datasets[i].xPos[j] ==
"undefined")) lgtxt2 = data.datasets[i].xPos[j]; | 6101 if (!(typeof data.datasets[i].xPos[j] ==
"undefined")) lgtxt2 = data.datasets[i].xPos[j]; |
| 6082 } | 6102 } |
| 6083 if (lgtxt2 == "" && !(typeof(data.labels[j]) ==
"undefined")) lgtxt2 = data.labels[j]; | 6103 if (lgtxt2 == "" && !(typeof(data.labels[j]) ==
"undefined")) lgtxt2 = data.labels[j]; |
| 6084 if (typeof lgtxt2 == "string") lgtxt2 = lgtxt2.t
rim(); | 6104 if (typeof lgtxt2 == "string") lgtxt2 = lgtxt2.t
rim(); |
| 6085 | 6105 |
| 6086 » » » » if (!(typeof(data.datasets[i].data[j]) == 'undef
ined')) { | 6106 //» » » » if (!(typeof(data.datasets[i].data[j]) == 'undef
ined') && data.datasets[i].data[j] != 0) { |
| 6107 » » » » if (!(typeof(data.datasets[i].data[j]) == 'undef
ined') ) { |
| 6087 cumvalue[axis][j]+=1*data.datasets[i].da
ta[j]; | 6108 cumvalue[axis][j]+=1*data.datasets[i].da
ta[j]; |
| 6088 switch(tpdraw(ctx,data.datasets[i])) { | 6109 switch(tpdraw(ctx,data.datasets[i])) { |
| 6089 case "Bar" : | 6110 case "Bar" : |
| 6090 case "StackedBar" : | 6111 case "StackedBar" : |
| 6091 case "HorizontalBar" : | 6112 case "HorizontalBar" : |
| 6092 case "HorizontalStackedBar" : | 6113 case "HorizontalStackedBar" : |
| 6093 | |
| 6094 result[i][j]= { | 6114 result[i][j]= { |
| 6095 config: config, | 6115 config: config, |
| 6096 v1: fmtChartJS(c
onfig, lgtxt, config.fmtV1), | 6116 v1: fmtChartJS(c
onfig, lgtxt, config.fmtV1), |
| 6097 v2: fmtChartJS(c
onfig, lgtxt2, config.fmtV2), | 6117 v2: fmtChartJS(c
onfig, lgtxt2, config.fmtV2), |
| 6098 v3: fmtChartJS(c
onfig, 1 * data.datasets[i].data[j], config.fmtV3), | 6118 v3: fmtChartJS(c
onfig, 1 * data.datasets[i].data[j], config.fmtV3), |
| 6099 v4: fmtChartJS(c
onfig, cumvalue[axis][j], config.fmtV4), | 6119 v4: fmtChartJS(c
onfig, cumvalue[axis][j], config.fmtV4), |
| 6100 v5: fmtChartJS(c
onfig, totvalue[axis][j], config.fmtV5), | 6120 v5: fmtChartJS(c
onfig, totvalue[axis][j], config.fmtV5), |
| 6101 v6: roundToWithT
housands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[ax
is][j], config.fmtV6), config.roundPct), | 6121 v6: roundToWithT
housands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[ax
is][j], config.fmtV6), config.roundPct), |
| 6122 v6T: roundToWith
Thousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / grandtotal
, config.fmtV6T), config.roundPct), |
| 6102 v11: fmtChartJS(
config, i, config.fmtV11), | 6123 v11: fmtChartJS(
config, i, config.fmtV11), |
| 6103 v12: fmtChartJS(
config, j, config.fmtV12), | 6124 v12: fmtChartJS(
config, j, config.fmtV12), |
| 6104 lgtxt: lgtxt, | 6125 lgtxt: lgtxt, |
| 6105 lgtxt2: lgtxt2, | 6126 lgtxt2: lgtxt2, |
| 6106 datavalue: 1 * d
ata.datasets[i].data[j], | 6127 datavalue: 1 * d
ata.datasets[i].data[j], |
| 6107 cumvalue: cumval
ue[axis][j], | 6128 cumvalue: cumval
ue[axis][j], |
| 6108 totvalue: totval
ue[axis][j], | 6129 totvalue: totval
ue[axis][j], |
| 6109 pctvalue: 100 *
data.datasets[i].data[j] / totvalue[axis][j], | 6130 pctvalue: 100 *
data.datasets[i].data[j] / totvalue[axis][j], |
| 6131 pctvalueT: 100 *
data.datasets[i].data[j] / grandtotal, |
| 6110 maxvalue : mxval
ue[axis][j], | 6132 maxvalue : mxval
ue[axis][j], |
| 6111 minvalue : mnval
ue[axis][j], | 6133 minvalue : mnval
ue[axis][j], |
| 6112 lmaxvalue : lmax
value[axis][i], | 6134 lmaxvalue : lmax
value[axis][i], |
| 6113 lminvalue : lmin
value[axis][i], | 6135 lminvalue : lmin
value[axis][i], |
| 6136 grandtotal : gra
ndtotal, |
| 6114 firstNotMissing
: firstNotMissingj[j], | 6137 firstNotMissing
: firstNotMissingj[j], |
| 6115 lastNotMissing :
lastNotMissingj[j], | 6138 lastNotMissing :
lastNotMissingj[j], |
| 6116 prevNotMissing :
prevnotemptyj, | 6139 prevNotMissing :
prevnotemptyj, |
| 6117 prevMissing : pr
evemptyj, | 6140 prevMissing : pr
evemptyj, |
| 6118 nextNotMissing :
-1, | 6141 nextNotMissing :
-1, |
| 6119 j: j, | 6142 j: j, |
| 6120 i: i, | 6143 i: i, |
| 6121 data: data | 6144 data: data |
| 6122 }; | 6145 }; |
| 6146 if(1 * data.datasets[i].
data[j]==0 && (tpdraw(ctx,data.datasets[i])=="HorizontalStackedBar" || tpdraw(ct
x,data.datasets[i])=="StackedBar"))result[i][j].v3=""; |
| 6123 break; | 6147 break; |
| 6124 case "Line" : | 6148 case "Line" : |
| 6125 case "Radar" : | 6149 case "Radar" : |
| 6126 result[i][j]= { | 6150 result[i][j]= { |
| 6127 config: config, | 6151 config: config, |
| 6128 v1: fmtChartJS(c
onfig, lgtxt, config.fmtV1), | 6152 v1: fmtChartJS(c
onfig, lgtxt, config.fmtV1), |
| 6129 v2: fmtChartJS(c
onfig, lgtxt2, config.fmtV2), | 6153 v2: fmtChartJS(c
onfig, lgtxt2, config.fmtV2), |
| 6130 v3: fmtChartJS(c
onfig, 1 * data.datasets[i].data[j], config.fmtV3), | 6154 v3: fmtChartJS(c
onfig, 1 * data.datasets[i].data[j], config.fmtV3), |
| 6131 v5: fmtChartJS(c
onfig, 1 * data.datasets[i].data[j], config.fmtV5), | 6155 v5: fmtChartJS(c
onfig, 1 * data.datasets[i].data[j], config.fmtV5), |
| 6132 » » » » » » » » v6: fmtChartJS(c
onfig, mxvalue[axis][j], config.fmtV7), | 6156 » » » » » » » » v6: fmtChartJS(c
onfig, mxvalue[axis][j], config.fmtV6), |
| 6133 » » » » » » » » v7: fmtChartJS(c
onfig, totvalue[axis][j], config.fmtV6), | 6157 » » » » » » » » v7: fmtChartJS(c
onfig, totvalue[axis][j], config.fmtV7), |
| 6134 v8: roundToWithT
housands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[ax
is][j], config.fmtV8), config.roundPct), | 6158 v8: roundToWithT
housands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[ax
is][j], config.fmtV8), config.roundPct), |
| 6159 v8T: roundToWith
Thousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / grandtotal
, config.fmtV8T), config.roundPct), |
| 6135 v11: fmtChartJS(
config, i, config.fmtV11), | 6160 v11: fmtChartJS(
config, i, config.fmtV11), |
| 6136 v12: fmtChartJS(
config, j, config.fmtV12), | 6161 v12: fmtChartJS(
config, j, config.fmtV12), |
| 6137 lgtxt: lgtxt, | 6162 lgtxt: lgtxt, |
| 6138 lgtxt2: lgtxt2, | 6163 lgtxt2: lgtxt2, |
| 6139 datavalue: 1 * d
ata.datasets[i].data[j], | 6164 datavalue: 1 * d
ata.datasets[i].data[j], |
| 6140 diffnext: 1 * da
ta.datasets[i].data[j], | 6165 diffnext: 1 * da
ta.datasets[i].data[j], |
| 6141 pctvalue: 100 *
data.datasets[i].data[j] / totvalue[axis][j], | 6166 pctvalue: 100 *
data.datasets[i].data[j] / totvalue[axis][j], |
| 6167 pctvalueT: 100 *
data.datasets[i].data[j] / grandtotal, |
| 6142 totvalue : totva
lue[axis][j], | 6168 totvalue : totva
lue[axis][j], |
| 6143 cumvalue: cumval
ue[axis][j], | 6169 cumvalue: cumval
ue[axis][j], |
| 6144 maxvalue : mxval
ue[axis][j], | 6170 maxvalue : mxval
ue[axis][j], |
| 6145 minvalue : mnval
ue[axis][j], | 6171 minvalue : mnval
ue[axis][j], |
| 6146 lmaxvalue : lmax
value[axis][i], | 6172 lmaxvalue : lmax
value[axis][i], |
| 6147 lminvalue : lmin
value[axis][i], | 6173 lminvalue : lmin
value[axis][i], |
| 6148 lminvalue : lmin
value[axis][i], | 6174 lminvalue : lmin
value[axis][i], |
| 6175 grandtotal : gra
ndtotal, |
| 6149 firstNotMissing
: firstNotMissingi[i], | 6176 firstNotMissing
: firstNotMissingi[i], |
| 6150 lastNotMissing :
lastNotMissingi[i], | 6177 lastNotMissing :
lastNotMissingi[i], |
| 6151 prevNotMissing :
prevnotemptyj, | 6178 prevNotMissing :
prevnotemptyj, |
| 6152 prevMissing : pr
evemptyj, | 6179 prevMissing : pr
evemptyj, |
| 6153 nextNotMissing :
-1, | 6180 nextNotMissing :
-1, |
| 6154 j: j, | 6181 j: j, |
| 6155 i: i, | 6182 i: i, |
| 6156 data: data | 6183 data: data |
| 6157 }; | 6184 }; |
| 6158 if(prevpos[axis][j]>=0){ | 6185 if(prevpos[axis][j]>=0){ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 6181 case "HorizontalBar" : | 6208 case "HorizontalBar" : |
| 6182 case "HorizontalStackedBar" : | 6209 case "HorizontalStackedBar" : |
| 6183 result[i][j] ={ | 6210 result[i][j] ={ |
| 6184 v1:lgtxt, | 6211 v1:lgtxt, |
| 6185 lmaxvalue : lmax
value[axis][i], | 6212 lmaxvalue : lmax
value[axis][i], |
| 6186 lminvalue : lmin
value[axis][i], | 6213 lminvalue : lmin
value[axis][i], |
| 6187 firstNotMissing
: firstNotMissingj[j], | 6214 firstNotMissing
: firstNotMissingj[j], |
| 6188 lastNotMissing :
lastNotMissingj[j], | 6215 lastNotMissing :
lastNotMissingj[j], |
| 6189 prevNotMissing :
prevnotemptyj, | 6216 prevNotMissing :
prevnotemptyj, |
| 6190 prevMissing : pr
evemptyj, | 6217 prevMissing : pr
evemptyj, |
| 6218 grandtotal : gra
ndtotal, |
| 6191 }; | 6219 }; |
| 6192 break; | 6220 break; |
| 6193 case "Line" : | 6221 case "Line" : |
| 6194 case "Radar" : | 6222 case "Radar" : |
| 6195 result[i][j] ={ | 6223 result[i][j] ={ |
| 6196 v1:lgtxt, | 6224 v1:lgtxt, |
| 6197 lmaxvalue : lmax
value[axis][i], | 6225 lmaxvalue : lmax
value[axis][i], |
| 6198 lminvalue : lmin
value[axis][i], | 6226 lminvalue : lmin
value[axis][i], |
| 6199 firstNotMissing
: firstNotMissingi[i], | 6227 firstNotMissing
: firstNotMissingi[i], |
| 6200 lastNotMissing :
lastNotMissingi[i], | 6228 lastNotMissing :
lastNotMissingi[i], |
| 6201 prevNotMissing :
prevnotemptyj, | 6229 prevNotMissing :
prevnotemptyj, |
| 6202 prevMissing : pr
evemptyj, | 6230 prevMissing : pr
evemptyj, |
| 6231 grandtotal : gra
ndtotal, |
| 6203 }; | 6232 }; |
| 6204 break; | 6233 break; |
| 6205 } | 6234 } |
| 6206 } | 6235 } |
| 6207 } | 6236 } |
| 6208 } | 6237 } |
| 6209 break; | 6238 break; |
| 6210 default: | 6239 default: |
| 6211 break; | 6240 break; |
| 6212 } | 6241 } |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6413 statData[i][j].v9=statData[i][j]
.xPosRight; | 6442 statData[i][j].v9=statData[i][j]
.xPosRight; |
| 6414 statData[i][j].v10=statData[i][j
].yPosTop; | 6443 statData[i][j].v10=statData[i][j
].yPosTop; |
| 6415 } | 6444 } |
| 6416 break; | 6445 break; |
| 6417 case "HorizontalStackedBar" : | 6446 case "HorizontalStackedBar" : |
| 6418 for (var j = 0; j < data.datasets[i].dat
a.length; j++) { | 6447 for (var j = 0; j < data.datasets[i].dat
a.length; j++) { |
| 6419 if (i == 0) { | 6448 if (i == 0) { |
| 6420 tempp[j]=0; | 6449 tempp[j]=0; |
| 6421 tempn[j]=0; | 6450 tempn[j]=0; |
| 6422 } | 6451 } |
| 6423 » » » » » » if ((typeof(data.datasets[i].dat
a[j]) == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; | 6452 » » » » » » if (typeof(data.datasets[i].data
[j]) == 'undefined') continue; |
| 6453 //» » » » » » if ((typeof(data.datasets[i].dat
a[j]) == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; |
| 6424 | 6454 |
| 6425 statData[i][j].xPosLeft= otherva
rs.yAxisPosX + config.barValueSpacing + othervars.valueHop * j; | 6455 statData[i][j].xPosLeft= otherva
rs.yAxisPosX + config.barValueSpacing + othervars.valueHop * j; |
| 6426 if (1*data.datasets[i].data[j]<0
) { | 6456 if (1*data.datasets[i].data[j]<0
) { |
| 6427 statData[i][j].leftval=t
empn[j]; | 6457 statData[i][j].leftval=t
empn[j]; |
| 6428 statData[i][j].rightval=
tempn[j]+1*data.datasets[i].data[j] ; | 6458 statData[i][j].rightval=
tempn[j]+1*data.datasets[i].data[j] ; |
| 6429 tempn[j]=tempn[j]+1*data
.datasets[i].data[j] ; | 6459 tempn[j]=tempn[j]+1*data
.datasets[i].data[j] ; |
| 6430 } else { | 6460 } else { |
| 6431 statData[i][j].leftval=t
empp[j]; | 6461 statData[i][j].leftval=t
empp[j]; |
| 6432 statData[i][j].rightval=
tempp[j]+1*data.datasets[i].data[j] ; | 6462 statData[i][j].rightval=
tempp[j]+1*data.datasets[i].data[j] ; |
| 6433 tempp[j]=tempp[j]+1*data
.datasets[i].data[j] ; | 6463 tempp[j]=tempp[j]+1*data
.datasets[i].data[j] ; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6543 else if(typeof optionvar == "object") { | 6573 else if(typeof optionvar == "object") { |
| 6544 for(var j=0;j<optionvar.length;j++) if (optionvar[j])ret
urn true; | 6574 for(var j=0;j<optionvar.length;j++) if (optionvar[j])ret
urn true; |
| 6545 return false; | 6575 return false; |
| 6546 } else return optionvar; | 6576 } else return optionvar; |
| 6547 }; | 6577 }; |
| 6548 | 6578 |
| 6549 function setOptionValue(reference,ctx,data,statData,optionvar,defaultvalue,posi,
posj,othervars) { | 6579 function setOptionValue(reference,ctx,data,statData,optionvar,defaultvalue,posi,
posj,othervars) { |
| 6550 | 6580 |
| 6551 if(typeof optionvar == "undefined") { | 6581 if(typeof optionvar == "undefined") { |
| 6552 if(typeof defaultvalue=="function") return defaultvalue(referenc
e,ctx,data,statData,posi,posj,othervars); | 6582 if(typeof defaultvalue=="function") return defaultvalue(referenc
e,ctx,data,statData,posi,posj,othervars); |
| 6553 » » else if(typeof defaultvalue == "object") return defaultvalue[Mat
h.min(defaultvalue.length-1,Math.max(0,posi))]; | 6583 » » else if(typeof defaultvalue == "object") { |
| 6584 » » » if(posj==-1)return defaultvalue[Math.min(defaultvalue.le
ngth-1,Math.max(0,posi))]; |
| 6585 » » » else return defaultvalue[Math.min(defaultvalue.length-1,
Math.max(0,posj))]; |
| 6586 » » } |
| 6554 else return defaultvalue; | 6587 else return defaultvalue; |
| 6555 } | 6588 } |
| 6556 if(typeof optionvar=="function") return optionvar(reference,ctx,data,sta
tData,posi,posj,othervars); | 6589 if(typeof optionvar=="function") return optionvar(reference,ctx,data,sta
tData,posi,posj,othervars); |
| 6557 » else if(typeof optionvar == "object") return optionvar[Math.min(optionva
r.length-1,Math.max(0,posi))]; | 6590 » else if(typeof optionvar == "object") { |
| 6591 » » if (posj==-1)return optionvar[Math.min(optionvar.length-1,Math.m
ax(0,posi))]; |
| 6592 » » else return optionvar[Math.min(optionvar.length-1,Math.max(0,pos
j))]; |
| 6593 » } |
| 6558 else return optionvar; | 6594 else return optionvar; |
| 6559 }; | 6595 }; |
| 6560 | 6596 |
| 6561 function tpdraw(ctx,dataval) { | 6597 function tpdraw(ctx,dataval) { |
| 6562 switch(ctx.tpchart) { | 6598 switch(ctx.tpchart) { |
| 6563 case "Bar" : | 6599 case "Bar" : |
| 6564 if (dataval.type=="Line") { tp="Line";} | 6600 if (dataval.type=="Line") { tp="Line";} |
| 6565 else {tp=ctx.tpchart;} | 6601 else {tp=ctx.tpchart;} |
| 6566 break; | 6602 break; |
| 6567 default : | 6603 default : |
| 6568 tp=ctx.tpchart; | 6604 tp=ctx.tpchart; |
| 6569 break; | 6605 break; |
| 6570 } | 6606 } |
| 6571 return tp; | 6607 return tp; |
| 6572 }; | 6608 }; |
| 6573 | 6609 |
| 6574 | 6610 |
| OLD | NEW |