44 changes: 4 additions & 40 deletions src/Resources/xml/home-perspectives.xml
Original file line number Diff line number Diff line change
Expand Up @@ -333,30 +333,6 @@
<property name="resizable" type="bool" value="0" />
<property name="settings" type="QString" value="{ &quot;title&quot;: &quot; &quot;,\n&quot;description&quot;: &quot;Peronnet Thibault Model, WKO4 Model is basically an unattributed rip-off &quot;,\n&quot;type&quot;: 1,\n&quot;animate&quot;: false,\n&quot;intervalrefresh&quot;: false,\n&quot;legendpos&quot;: 2,\n&quot;stack&quot;: false,\n&quot;orientation&quot;: 1,\n&quot;bgcolor&quot;: &quot;#010102&quot;, \n&quot;scale&quot;: 1,\n&quot;SERIES&quot;: [\n{ &quot;name&quot;: &quot;Model &quot;, &quot;group&quot;: &quot; &quot;, &quot;xname&quot;: &quot;seconds &quot;, &quot;yname&quot;: &quot;watts &quot;, &quot;program&quot;: &quot;{:sl:n:sl:n finalise {:sl:n # raw data to fit with, just first 2hr:sl:n mmp &lt;- head(meanmax(POWER),10000);:sl:n secs &lt;- seq(1,length(mmp),1);:sl:n multiuniq(mmp,secs);:sl:n:sl:n # fit starting values:sl:n ftp &lt;- 200; frc&lt;-11000; pmax &lt;- 1000; a&lt;-40;:sl:n tau2&lt;-50; tte&lt;-1800;:sl:n:sl:n fit &lt;- lm((frc:sl:/x*(1-exp(-x:sl:/(frc:sl:/pmax)))) + ((ftp*(1-exp(-x:sl:/tau2))) - (bool(x&gt;tte)*(a*log(x:sl:/tte)))), secs,mmp);:sl:n:sl:n # success, generate prediction data:sl:n if (fit[0] &lt;&gt; 0) { :sl:n annotate(label, :qu:Pmax:qu:, round(pmax));:sl:n annotate(label, :qu:FTP:qu:, round(ftp));:sl:n annotate(label, :qu:FRC:qu:, round(frc));:sl:n annotate(label, :qu:TTE:qu:, round(tte)); :sl:n :sl:n # cache the paramters so we can use them:sl:n store(:qu:ftp:qu:,ftp);:sl:n store(:qu:frc:qu:,frc);:sl:n store(:qu:pmax:qu:,pmax);:sl:n store(:qu:tte:qu:,tte);:sl:n store(:qu:a:qu:,a);:sl:n store(:qu:tau2:qu:,tau2);:sl:n store(:qu:secs:qu:, secs);:sl:n:sl:n # generate the model curve:sl:n yy &lt;- sapply(secs, (frc:sl:/x*(1-exp(-x:sl:/(frc:sl:/pmax)))) + ((ftp*(1-exp(-x:sl:/tau2))) - (bool(x&gt;tte)*(a*log(x:sl:/tte))))); :sl:n:sl:n }:sl:n:sl:n }:sl:n:sl:n x { round(secs); }:sl:n y { round(yy); }:sl:n}:sl:n &quot;, &quot;line&quot;: 1, &quot;symbol&quot;: 0, &quot;size&quot;: 2, &quot;color&quot;: &quot;#ff0004&quot;, &quot;opacity&quot;: 100, &quot;legend&quot;: true, &quot;opengl&quot;: true, &quot;datalabels&quot;: false, &quot;aggregate&quot;: 1, &quot;fill&quot;: false},\n{ &quot;name&quot;: &quot;Bests &quot;, &quot;group&quot;: &quot; &quot;, &quot;xname&quot;: &quot;seconds &quot;, &quot;yname&quot;: &quot;watts &quot;, &quot;program&quot;: &quot;{:sl:n:sl:n finalise {:sl:n # raw data to fit with, just first 20 minutes:sl:n mmp &lt;- head(meanmax(POWER),10000);:sl:n secs &lt;- seq(1,length(mmp),1);:sl:n }:sl:n:sl:n x { round(secs); }:sl:n y { round(mmp); }:sl:n}:sl:n &quot;, &quot;line&quot;: 3, &quot;symbol&quot;: 0, &quot;size&quot;: 3, &quot;color&quot;: &quot;#ffa71a&quot;, &quot;opacity&quot;: 100, &quot;legend&quot;: true, &quot;opengl&quot;: false, &quot;datalabels&quot;: false, &quot;aggregate&quot;: 1, &quot;fill&quot;: false},\n{ &quot;name&quot;: &quot;pFRC &quot;, &quot;group&quot;: &quot; &quot;, &quot;xname&quot;: &quot;seconds &quot;, &quot;yname&quot;: &quot;watts &quot;, &quot;program&quot;: &quot;{:sl:n:sl:n finalise {:sl:n # cache the paramters so we can use them:sl:n ftp &lt;- fetch(:qu:ftp:qu:);:sl:n frc &lt;- fetch(:qu:frc:qu:);:sl:n pmax&lt;- fetch(:qu:pmax:qu:);:sl:n tte&lt;- fetch(:qu:tte:qu:);:sl:n a&lt;- fetch(:qu:a:qu:);:sl:n tau2&lt;- fetch(:qu:tau2:qu:);:sl:n secs&lt;- fetch(:qu:secs:qu:);:sl:n:sl:n # generate the model curve:sl:n yy &lt;- sapply(secs, frc:sl:/x*(1-exp(-x:sl:/(frc:sl:/pmax)))); :sl:n:sl:n }:sl:n:sl:n x { round(secs); }:sl:n y { round(yy); }:sl:n}:sl:n &quot;, &quot;line&quot;: 1, &quot;symbol&quot;: 0, &quot;size&quot;: 2, &quot;color&quot;: &quot;#113dff&quot;, &quot;opacity&quot;: 100, &quot;legend&quot;: true, &quot;opengl&quot;: false, &quot;datalabels&quot;: false, &quot;aggregate&quot;: 1, &quot;fill&quot;: false},\n{ &quot;name&quot;: &quot;pFTP &quot;, &quot;group&quot;: &quot; &quot;, &quot;xname&quot;: &quot;seconds &quot;, &quot;yname&quot;: &quot;watts &quot;, &quot;program&quot;: &quot;{:sl:n:sl:n finalise {:sl:n # cache the paramters so we can use them:sl:n ftp &lt;- fetch(:qu:ftp:qu:);:sl:n frc &lt;- fetch(:qu:frc:qu:);:sl:n pmax&lt;- fetch(:qu:pmax:qu:);:sl:n tte&lt;- fetch(:qu:tte:qu:);:sl:n a&lt;- fetch(:qu:a:qu:);:sl:n tau2&lt;- fetch(:qu:tau2:qu:);:sl:n secs&lt;- fetch(:qu:secs:qu:);:sl:n:sl:n # generate the model curve:sl:n yy &lt;- sapply(secs, ((ftp*(1-exp(-x:sl:/tau2))) - (bool(x&gt;tte)*(a*log(x:sl:/tte))))); :sl:n:sl:n }:sl:n:sl:n x { round(secs); }:sl:n y { round(yy); }:sl:n}:sl:n &quot;, &quot;line&quot;: 1, &quot;symbol&quot;: 0, &quot;size&quot;: 2, &quot;color&quot;: &quot;#4bc045&quot;, &quot;opacity&quot;: 100, &quot;legend&quot;: true, &quot;opengl&quot;: true, &quot;datalabels&quot;: false, &quot;aggregate&quot;: 1, &quot;fill&quot;: false} ]\n,\n&quot;AXES&quot;: [\n{ &quot;name&quot;: &quot;seconds &quot;, &quot;type&quot;: 0, &quot;orientation&quot;: 1, &quot;align&quot;: 1, &quot;minx&quot;: 1, &quot;maxx&quot;: 10000, &quot;miny&quot;: 0, &quot;maxy&quot;: 0, &quot;smooth&quot;: 0, &quot;groupby&quot;: 0, &quot;visible&quot;: true, &quot;fixed&quot;: true, &quot;log&quot;: true, &quot;minorgrid&quot;: false, &quot;majorgrid&quot;: true, &quot;labelcolor&quot;: &quot;#2684f6&quot;, &quot;axiscolor&quot;: &quot;#2684f6&quot;},\n{ &quot;name&quot;: &quot;watts &quot;, &quot;type&quot;: 0, &quot;orientation&quot;: 2, &quot;align&quot;: 1, &quot;minx&quot;: 0, &quot;maxx&quot;: 0, &quot;miny&quot;: 0, &quot;maxy&quot;: 950, &quot;smooth&quot;: 0, &quot;groupby&quot;: 0, &quot;visible&quot;: true, &quot;fixed&quot;: true, &quot;log&quot;: false, &quot;minorgrid&quot;: false, &quot;majorgrid&quot;: true, &quot;labelcolor&quot;: &quot;#ff0004&quot;, &quot;axiscolor&quot;: &quot;#ff0004&quot;} ]\n}" />
</chart>
<chart id="39" name="" title="Power Profile (R)" >
<property name="title" type="QString" value="Power Profile (R)" />
<property name="subtitle" type="QString" value="" />
<property name="widthFactor" type="double" value="2" />
<property name="heightFactor" type="double" value="2" />
<property name="style" type="int" value="0" />
<property name="resizable" type="bool" value="0" />
<property name="script" type="QString" value="library(fmsb)\nWeight=as.numeric(GC.athlete()[4])\nmmp &lt;- GC.season.meanmax(compare=FALSE)\nmm &lt;- mmp$wpk\n\ntime &lt;- seq(5, 3600, 1)\n\n\nlbltime&lt;-c(30,60,240,300,600,1200,3600,7200,5)\n\nlab&lt;-c(&quot;30s&quot;,&quot;1m&quot;,&quot;4m&quot;,&quot;5m&quot;,&quot;10m&quot;,&quot;20m&quot;,&quot;1h&quot;,&quot;2h&quot;,&quot;5s&quot;)\n\np_max &lt;- round(mmp$power[lbltime])\nppr&lt;-as.data.frame(t(p_max))\ncolnames(ppr)=lab\nppr=round((ppr/Weight),1)\n\nmax=c(15.1,11.5,7.4,7.2,6.8,6.2,5.6,4.7,23.1)\n\nppr=rev(ppr/max)\n\nppr &lt;- rbind(rep(1,10) , rep(0.4,10) , ppr)\n \nradarchart( ppr , axistype=1 , \n #custom polygon\n pcol=&quot;cyan&quot; , pfcol=rgb(0.2,0.5,0.5,0.5) , plwd=2 , \n \n #custom the grid\n cglcol=&quot;red&quot;, cglty=1, axislabcol=&quot;green3&quot;, cglwd=1,caxislabels=seq(40,100,10),seg=6,\n title=paste(&quot;Cyclist profile:&quot;,GC.athlete()[1]),\n\nvlabels=rev(c(&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;)),\n \n #custom labels\n vlcex=1\n )\n\ntext(0.22,1.07,paste(&quot;P :&quot;,p_max[9],&quot;W\n\nPI : &quot;,round(ppr[3,1],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(0,1.2,paste(&quot;5 sec.&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(0.95,0.78,paste(&quot;P :&quot;,p_max[1],&quot;W\n\nPI : &quot;,round(ppr[3,9],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(0.77,0.92,paste(&quot;30 sec.&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(1.2,0.07,paste(&quot;P :&quot;,p_max[2],&quot;W\n\nPI : &quot;,round(ppr[3,8],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(1.18,0.21,paste(&quot;1 min&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(1,-0.75,paste(&quot;P :&quot;,p_max[3],&quot;W\n\nPI : &quot;,round(ppr[3,7],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(1.07,-0.6,paste(&quot;4 min&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(0.4,-1.18,paste(&quot;P :&quot;,p_max[4],&quot;W\n\nPI : &quot;,round(ppr[3,6],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(0.4,-1.05,paste(&quot;5 min&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(-0.4,-1.18,paste(&quot;P :&quot;,p_max[5],&quot;W\n\nPI : &quot;,round(ppr[3,5],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(-0.4,-1.05,paste(&quot;10 min&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(-1,-0.75,paste(&quot;P :&quot;,p_max[6],&quot;W\n\nPI : &quot;,round(ppr[3,4],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(-1,-0.6,paste(&quot;20 min&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(-1.2,0.08,paste(&quot;P :&quot;,p_max[7],&quot;W\n\nPI : &quot;,round(ppr[3,3],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(-1.19,0.21,paste(&quot;60 min&quot;),cex=1.25,col=&quot;green3&quot;)\n\ntext(-0.9,0.78,paste(&quot;P :&quot;,p_max[8],&quot;W\n\nPI : &quot;,round(ppr[3,2],3)*100),cex=1,col=&quot;dodgerblue1&quot;)\ntext(-0.78,0.92,paste(&quot;2 H&quot;),cex=1.25,col=&quot;green3&quot;)" />
<property name="state" type="QString" value="" />
<property name="plotOnChart" type="bool" value="0" />
<property name="showConsole" type="bool" value="0" />
</chart>
<chart id="39" name="" title="Fatigue Profile (R)" >
<property name="title" type="QString" value="Fatigue Profile (R)" />
<property name="subtitle" type="QString" value="" />
<property name="widthFactor" type="double" value="2" />
<property name="heightFactor" type="double" value="2" />
<property name="style" type="int" value="0" />
<property name="resizable" type="bool" value="0" />
<property name="script" type="QString" value="##############################################################################\n## PULL THE ACTIVITY METRICS\n#GC.page(1024,1000)\nathlete = GC.athlete()\nmmp &lt;- GC.season.meanmax(compare=FALSE)\nint_duration &lt;- c(5,10,20, 30,60,120, 180,300,480, 1200,3600,5400)\nint_dur_str &lt;- c(&quot;NP-5s&quot;,&quot;NP-10s&quot;,&quot;NP-20s&quot;,&quot;AC-30s&quot;,&quot;AC-1m&quot;,&quot;AC-2m&quot;,&quot;VO2-3m&quot;,&quot;VO2-5m&quot;,&quot;VO2-8min&quot;,&quot;LT-20m&quot;,&quot;LT-1h&quot;,&quot;LT-1h30&quot;)\np_max &lt;- mmp$power[int_duration] # max power data\np_max[c(11,12)] = mmp$IsoPower[int_duration[c(11,12)]] # NP for 1h and 1h30\np_max_wpk &lt;- mmp$wpk[c(5,60,300,2500)] # W/k data\n\n#p_max[1] = 1200\n#p_max[5] = 2000\n#p_max[8] = 2000\n#p_max[11] = 2000\n\n\nif (athlete$gender==&apos;male&apos;) \n{\n limits_5s &lt;- c(12.15,13.93,15.70,17.48,19.55,21.33,23.11)\n limits_1m &lt;- c(6.44, 7.13, 7.82, 8.51 , 9.32 , 10.1 , 10.7)\n limits_5m &lt;- c(3.05, 3.67, 4.29, 4.91 , 5.64 , 6.26 , 6.88)\n limits_1h &lt;- c(2.49, 3.02, 3.55, 4.09 , 4.71 , 5.24 , 5.78)\n}\n\ncategory_string &lt;- c(&quot;untrained&quot;,&quot;fair&quot;,&quot;moderate&quot;,&quot;good&quot;,&quot;very good&quot;,&quot;excellent&quot;,&quot;exceptional&quot;,&quot;world class&quot;)\ncategory_col &lt;- c(&quot;darkred&quot; ,&quot;red&quot; ,&quot;orange&quot;,&quot;yellow&quot;,&quot;lightgreen&quot;,&quot;green4&quot;,&quot;darkgreen&quot;,&quot;purple&quot;)\n#c_border = c(&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;,&quot;white&quot;)\n\np_max_5s = limits_5s*athlete$weight\np_max_1m = limits_1m*athlete$weight\np_max_5m = limits_5m*athlete$weight\np_max_1h = limits_1h*athlete$weight\n\n\nif (athlete$gender==&apos;male&apos;) \n{\n w_above_avg &lt;- c(0,0.15,0.20 ,0,0.10,0.15, 0,0.04,0.10, 0,0.02,0.05)\n above_avg &lt;- c(0,0.22,0.35, 0,0.21,0.23, 0,0.08,0.18, 0,0.04,0.08)\n at_average &lt;- c(0,0.31,0.47, 0,0.25,0.36, 0,0.15,0.24, 0,0.07,0.15)\n below_avg &lt;- c(0,0.41,0.61, 0,0.31,0.50, 0,0.20,0.30, 0,0.11,0.25)\n}\np_ref = c(p_max[1],p_max[1],p_max[1],p_max[4],p_max[4],p_max[4],p_max[7],p_max[7],p_max[7],p_max[10],p_max[10],p_max[10])\np_w_above = p_ref*(1-w_above_avg)\np_above = p_ref*(1-above_avg)\np_at = p_ref*(1-at_average)\np_below = p_ref*(1-below_avg)\n\nc_plot = c(&quot;grey&quot;,&quot;white&quot;,&quot;white&quot;,&quot;grey&quot;,&quot;white&quot;,&quot;white&quot;,&quot;grey&quot;,&quot;white&quot;,&quot;white&quot;,&quot;grey&quot;,&quot;white&quot;,&quot;white&quot;)\nzone_nam &lt;-c(&quot;well above average&quot;,&quot;above average&quot;,&quot;average&quot;,&quot;below average&quot;,&quot;well below average&quot;)\nzone_col &lt;-c(&quot;green4&quot;,&quot;lightgreen&quot;,&quot;yellow&quot;,&quot;red&quot;,&quot;darkred&quot;)\nc_plot[p_max&gt;p_w_above] = zone_col[1] # well above\nc_plot[p_max&lt;p_w_above&amp;p_max&gt;p_above] = zone_col[2] # above\nc_plot[p_max&lt;p_above&amp;p_max&gt;p_at] = zone_col[3] # average\nc_plot[p_max&lt;p_at&amp;p_max&gt;p_below]= zone_col[4] # below \nc_plot[p_max&lt;p_below] = zone_col[5] # well below\n\nc_border = c_plot\nc_border[1] =category_col[findInterval(p_max[1],p_max_5s)+1]\nc_border[5] =category_col[findInterval(p_max[5],p_max_1m)+1]\nc_border[8] =category_col[findInterval(p_max[8],p_max_5m)+1]\nc_border[11]=category_col[findInterval(p_max[11],p_max_1h)+1]\n\n\ntxt_sz =1.3\nopar &lt;- par(lwd = 5)\nx &lt;- barplot(p_max,names=int_dur_str, col=c_plot, ylim=c(0, max(p_max)*1.3),cex.axis=txt_sz, cex.names=txt_sz, border=c_border) \nopar &lt;- par(lwd = 1)\n\n#abline(h=p_ref,slope=0,col=&quot;white&quot;,lty=2)\ntitle(main=&quot;Power and Fatigue Profile&quot;,xlab=&quot;Interval Time&quot;,ylab=&quot;MaxPower(W)&quot;,cex.main=txt_sz*txt_sz,cex.lab=txt_sz)\n#legend(&quot;topright&quot;,title=&quot;sdf&quot;, col=&quot;white&quot;,c(&quot;reference int. time&quot;,zone_nam),fill=c(&quot;grey&quot;,zone_col))\n#legend(&quot;right&quot;,c(&quot;reference int. time&quot;,zone_nam),fill=c(&quot;grey&quot;,zone_col))\n\nlegend(&quot;topright&quot;, inset=.02, title=&quot;Bar Color: Fatigue Profile&quot;, c(&quot;fatigue reference interval&quot;,zone_nam), fill=c(&quot;grey&quot;,zone_col), horiz=FALSE, cex=txt_sz)\nlegend(&quot;top&quot;, inset=.02, title=&quot;Border Color: Power Profile&quot; ,category_string, fill=category_col, horiz=FALSE, cex=txt_sz)\n\nlines(x,p_w_above ,type=&quot;b&quot;,col=zone_col[1],lwd=2)\nlines(x,p_above ,type=&quot;b&quot;,col=zone_col[2],lwd=2)\nlines(x,p_at ,type=&quot;l&quot;,col=zone_col[3],lty=&quot;dotted&quot;,lwd=2)\nlines(x,p_below ,type=&quot;b&quot;,col=zone_col[4],lwd=2)\ntext(x,(max(p_max)-min(p_max))/7,paste0(round(p_max),&quot;W&quot;), pos=1, col=&quot;black&quot;,cex=txt_sz)#opar &lt;- par(lwd = 1)\n\nfor (cat in 1:7)\n{ \n lines(c(x[1]-0.5,x[1]+0.5),c(p_max_5s[cat],p_max_5s[cat]), col=&quot;black&quot;)\n text(x[1],p_max_5s[cat]-(p_max_5s[7]-p_max_5s[1])/14, category_string[cat], cex=txt_sz*1., col=&quot;black&quot;)\n lines(c(x[5]-0.5,x[5]+0.5),c(p_max_1m[cat],p_max_1m[cat]), col=&quot;black&quot;)\n text(x[5],p_max_1m[cat]-(p_max_1m[7]-p_max_1m[1])/14, category_string[cat], cex=txt_sz*1., col=&quot;black&quot;)\n lines(c(x[8]-0.5,x[8]+0.5),c(p_max_5m[cat],p_max_5m[cat]), col=&quot;black&quot;)\n text(x[8],p_max_5m[cat]-(p_max_5m[7]-p_max_5m[1])/14, category_string[cat], cex=txt_sz*1., col=&quot;black&quot;)\n lines(c(x[11]-0.5,x[11]+0.5),c(p_max_1h[cat],p_max_1h[cat]), col=&quot;black&quot;)\n text(x[11],p_max_1h[cat]-(p_max_1h[7]-p_max_1h[1])/14, category_string[cat], cex=txt_sz*1., col=&quot;black&quot;)\n}\ntext(x[1],p_max_5s[7]+(p_max_5s[7]-p_max_5s[1])/14, category_string[8], cex=txt_sz*1., col=&quot;black&quot;)\ntext(x[5],p_max_1m[7]+(p_max_1m[7]-p_max_1m[1])/14, category_string[8], cex=txt_sz*1., col=&quot;black&quot;)\ntext(x[8],p_max_5m[7]+(p_max_5m[7]-p_max_5m[1])/14, category_string[8], cex=txt_sz*1., col=&quot;black&quot;)\ntext(x[11],p_max_1h[7]+(p_max_1h[7]-p_max_1h[1])/14, category_string[8], cex=txt_sz*1.,col=&quot;black&quot;)\n\n\n## Summary Box Labels\ntext(x[1],(max(p_max)-min(p_max))/20, paste0(round(p_max[1]/athlete$weight,2),&quot;W/kg&quot; ),cex=txt_sz*0.8,col=&quot;darkblue&quot;)\ntext(x[5],(max(p_max)-min(p_max))/20, paste0(round(p_max[5]/athlete$weight,2),&quot;W/kg&quot; ),cex=txt_sz*0.8,col=&quot;darkblue&quot;)\ntext(x[8],(max(p_max)-min(p_max))/20, paste0(round(p_max[8]/athlete$weight,2),&quot;W/kg&quot; ),cex=txt_sz*0.8,col=&quot;darkblue&quot;)\ntext(x[11],(max(p_max)-min(p_max))/20,paste0(round(p_max[11]/athlete$weight,2),&quot;W/kg(NP)&quot; ),cex=txt_sz*0.8,col=&quot;darkblue&quot;)\ntext(x[4],p_max[1]*1.13,paste0(&quot;Name: &quot;, athlete$name) ,cex=txt_sz*1.,col=&quot;yellow&quot;)\ntext(x[4],p_max[1]*1.10,paste0(&quot;Gender: &quot;, athlete$gender) ,cex=txt_sz*1.,col=&quot;yellow&quot;)\ntext(x[4],p_max[1]*1.07,paste0(&quot;Weight: &quot;, athlete$weight, &quot;kg&quot;) ,cex=txt_sz*1.,col=&quot;yellow&quot;)\n#text(x[6],p_max[1]*1.04, ,cex=txt_sz*1.,col=&quot;yellow&quot;)\n#text(x[6],p_max[1]*1.01, ,cex=txt_sz*1.,col=&quot;yellow&quot;)\n#text(x[6],p_max[1]*0.98, ,cex=txt_sz*1.,col=&quot;yellow&quot;)\n#text(x[6],p_max[1]*0.95, ,cex=txt_sz*1.,col=&quot;yellow&quot;)\n\n\n" />
<property name="state" type="QString" value="" />
<property name="plotOnChart" type="bool" value="0" />
<property name="showConsole" type="bool" value="0" />
</chart>
</layout>
<layout name="Triathlon" style="0" type="8" expression="" trainswitch="0">
<chart id="47" name="" title="Overview" >
Expand Down Expand Up @@ -537,29 +513,17 @@
<property name="settings" type="LTMSettings" value="/////wAAABwATABhAHMAdAAgADEAMgAgAG0AbwBuAHQAaABzACWHLAAAAAD/ACWImgAAAAD/AAAAAgAB////////////////AAAAFQAAAAMAAAAIAP////8AAAAAAAAACABTAHcAaQBtAAAABABrAG0AAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAADI1pgAAAAAAwZvUAAAAAB/////wH//6qq/////wAAAAAAAD/wAAAAAAAAAAAAAAH//wAAAAAAAAAAAAAAAAAAAAPnAAAOEP////8AAAAKAAAABAAAAAAAAAAADAAyACAAUABhAHIAbQAAAAAAAAPnAAAOEAABAAAAAP////8AAAAyACMAIABTAHcAaQBtAAoARABpAHMAdABhAG4AYwBlAF8AUwB3AGkAbQAvADEAMAAwADAAAAAAAAAAIABmAGkAbAB0AGUAcgA6AGkAcwBTAHcAaQBtADwAPgAwAAAAAAAAAAABAQD/////AAAACAD/////AAAAAAAAAAgAQgBpAGsAZQAAAAQAawBtAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAyNaYAAAAAAMGb1AAAAAAf////8B//9VVf//f38AAAAAAAA/8AAAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAAAAAAD5wAADhD/////AAAACgAAAAQAAAAAAAAAAAwAMgAgAFAAYQByAG0AAAAAAAAD5wAADhAAAQAAAAD/////AAAAHgAjACAAQgBpAGsAZQAKAEQAaQBzAHQAYQBuAGMAZQAAAAAAAAAmAGYAaQBsAHQAZQByADoAUwBwAG8AcgB0AD0AIgBCAGkAawBlACIAAAAAAAAAAAEBAP////8AAAAIAP////8AAAAAAAAABgBSAHUAbgAAAAQAawBtAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAyNaYAAAAAAMGb1AAAAAAf////8B/////6qqf38AAAAAAAA/8AAAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAAAAAAD5wAADhD/////AAAACgAAAAQAAAAAAAAAAAwAMgAgAFAAYQByAG0AAAAAAAAD5wAADhAAAQAAAAD/////AAAAHAAjACAAUgB1AG4ACgBEAGkAcwB0AGEAbgBjAGUAAAAAAAAAHgBmAGkAbAB0AGUAcgA6AGkAcwBSAHUAbgA8AD4AMAAAAAAAAAAAAQEA/////wAAAAAAAw==" />
<property name="useSelected" type="int" value="0" />
</chart>
<chart id="39" name="" title="Run Profile (R)" >
<property name="title" type="QString" value="Run Profile (R)" />
<property name="subtitle" type="QString" value="" />
<property name="widthFactor" type="double" value="2" />
<property name="heightFactor" type="double" value="2" />
<property name="style" type="int" value="0" />
<property name="resizable" type="bool" value="0" />
<property name="script" type="QString" value="## CHART SIZING\nGC.page(width=800, height=600)\n\n## PULL THE ACTIVITY METRICS FROM GC RECORDS\nmm &lt;- GC.season.meanmax(all=FALSE, filter=&quot;isRun&lt;&gt;0&quot;, compare=FALSE)\nathlete &lt;- GC.athlete()\nseasons &lt;- GC.season(compare=TRUE)\n\n## MANIPULATE THE DATA\n# mean maximal speed in m/s from 1s to 1h30&apos; (OJO con el ultimo ****)\nspeed &lt;- mm$speed[2:12000]/3.6\n# pace from speed in min/km\npace &lt;- (1000/60)/speed\n# distance from mean maximal speed\ndistance &lt;- round(speed*(1:length(pace))/1000,1)\n\ndistance.value &lt;- c(0, 0.4, 0.8, 1.5, 5, 10, 21.1, 42.2)\ndistance.name &lt;-c (&quot;&quot;, &quot;400m&quot;, &quot;800m&quot;, &quot;1500m&quot;, &quot;5k&quot;, &quot;10k&quot;, &quot;1/2 Mar&quot;, &quot;Marathon&quot;)\n\ndf.working &lt;- data.frame(distance, pace, speed)\ndf.working &lt;- subset(df.working, distance==distance.value)\ndf.working &lt;- aggregate(.~distance, df.working, mean)\nnames(df.working)[names(df.working)==&quot;distance&quot;] &lt;- &quot;distance.value&quot;\n\n## Account for Different Genders\nifelse (athlete$gender==&apos;male&apos;, index.TOP&lt;-c(NA, 9.26, 7.93, 7.28, 6.6, 6.34, 6.02, 5.72), index.TOP&lt;-c(NA, 8.4, 7.06, 6.52, 5.87, 5.4, 5.19))\nifelse (athlete$gender==&apos;male&apos;, index.BOT&lt;-c(NA, 3.27, 2.8, 2.57, 2.33, 2.24, 2.13, 2.02), index.BOT&lt;-c(NA, 2.97, 2.5, 2.3, 2.08, 1.91, 1.84))\n\n## Build the DataFrame\ndf.final &lt;- data.frame(distance.value, distance.name)\ndf.final &lt;- merge(df.final, df.working, all.x=TRUE)\nindex &lt;-((df.final$speed-index.BOT)/(index.TOP-index.BOT))*10\ndf.final &lt;- cbind(df.final, index)\n\n## Round the Numbers to make the frame more readable\ndf.final$pace &lt;- round(df.final$pace, 2)\ndf.final$speed &lt;- round(df.final$speed, 2)\ndf.final$index &lt;- round(df.final$index, 2)\n\n## Remove Wacky Values off the Scale\ndf.final$index &lt;- ifelse(df.final$index&lt;0, NA, df.final$index)\ndf.final$index &lt;- ifelse(df.final$index&gt;10, NA, df.final$index)\n\n## Athlete Phenotype\npheno.lbl &lt;- c(NA, &quot;1. T-MD&quot;, &quot;1. T-MD&quot;, &quot;2. T-LD&quot;, &quot;2. T-LD&quot;, &quot;2. T-LD&quot;, &quot;3. Mar&quot;, &quot;3. Mar&quot;)\ndf.pheno &lt;- data.frame(pheno.lbl, df.final$index)\ndf.pheno &lt;- aggregate(.~pheno.lbl, df.pheno, max, na.rm=TRUE, na.action=&quot;na.pass&quot;)\n# df.pheno[ is.na(df.pheno) ] &lt;- NA \n# df.pheno[which(!is.finite(df.pheno))] &lt;- NA\nis.na(df.pheno)&lt;-sapply(df.pheno, is.infinite)\ndf.pheno[is.na(df.pheno)]&lt;-NA\n\npheno.allrounderband = 1\npheno.best &lt;- which(df.pheno$frame.index==max(df.pheno$frame.index, na.rm=TRUE))\n\nif (sum(is.na(df.pheno$frame.index))&gt;0) {\n phenotype=&quot;Not Enough Datapoints&quot;\n} else if (max(df.pheno$frame.index, na.rm=TRUE)-min(df.pheno$frame.index, na.rm=TRUE)&lt;pheno.allrounderband) {\n phenotype=&quot;All-Rounder&quot;\n} else if (pheno.best==1) {\n phenotype&lt;-&quot;Track - Middle Distance&quot;\n} else if (pheno.best==2) {\n phenotype&lt;-&quot;Track - Long Distance&quot;\n} else\n phenotype&lt;-&quot;Marathoner&quot;\n\n## CHART INPUTS &amp; SETTINGS\nchart.lbl.yaxis&lt;-c(&quot;Untrained&quot;, &quot;Novice&quot;, &quot;Fair&quot;, &quot;Moderate&quot;, &quot;Good&quot;, &quot;Very Good&quot;, &quot;NCAA Div.3&quot;, &quot;NCAA Div.1&quot;, &quot;World Class&quot;)\nchart.lbl.sub = &quot;Run Distance&quot;\nchart.lbl.title = paste0(&quot;Runner Pace Profile &quot;, &quot; (&quot;, seasons$name, &quot;)&quot;)\nchart.in.textsize=1\nchart.in.chart.color1=&quot;Red&quot;\nchart.in.chart.color2=&quot;White&quot;\nchart.indices.posy&lt;-c(0, 0.87, 1.9, 3.08, 4.39, 5.74, 7.01, 7.98, 10)\n\n## Bar Value Labels\nchart.lbl.posx&lt;-c(0.8, 2, 3.2, 4.4, 5.6, 6.8, 8, 9.2)-0.15\nchart.lbl.posy&lt;-c(df.final$index-0.3)\nchart.in.textscale = 0.9\n\n## Make the M:SS Labels\nchart.lbl.val.minute &lt;- as.integer(df.final$pace)\nchart.lbl.val.second &lt;- round((df.final$pace-as.integer(df.final$pace))*60, 0)\nchart.lbl.val.second &lt;- sprintf(&quot;%02i&quot;, chart.lbl.val.second)\nchart.lbl.val.pace &lt;- paste0(chart.lbl.val.minute, &quot;:&quot;, chart.lbl.val.second, &quot;/km&quot;)\n\n## Total Event Time Labels\nchart.lbl.val.totaltime &lt;- (df.final$pace*df.final$distance.value)/1440\nchart.lbl.val.totaltime &lt;- format(as.POSIXct(Sys.Date() + chart.lbl.val.totaltime), &quot;%H:%M:%S&quot;, tz=&quot;UTC&quot;)\n\n## Summary Box Labels\nchart.summarybox.text &lt;- c(paste0(&quot;Athlete: &quot;, athlete$name), paste0(&quot;Gender: &quot;, athlete$gender), paste0(&quot;Weight: &quot;, athlete$weight, &quot;kg&quot;), paste0(&quot;Phenotype: &quot;, phenotype))\nchart.summarybox.posy &lt;- c(9.6, 9.2, 8.8, 8.4)\n\n## PLOT THE CHART\n## BarPlot\nbarplot(rep(NA, length(df.final$index)),\n xlim=c(0, 9.6),\n ylim=c(0, 10),\n main=chart.lbl.title,\n cex.main=1.5,\n font.main=2,\n sub=chart.lbl.sub,\n font.xlab=2,\n col=heat.colors(9),\n names.arg=df.final$distance.name,\n yaxt=&apos;n&apos;,\n space=0.2,\n col.axis=chart.in.chart.color2,\n col.sub=chart.in.chart.color2)\n\n## Reference Lines\nabline(h=chart.indices.posy, slope=0, col=&quot;gray50&quot;, lty=3)\ntext(0.42, chart.indices.posy+(0.2), chart.lbl.yaxis, cex=chart.in.textsize, col=chart.in.chart.color2)\nabline(h=10, slope=0, col=&quot;gray50&quot;, lty=3)\ntext(0.42, 10-(0.3), &quot;World Record&quot;, cex=chart.in.textsize, col=chart.in.chart.color2)\n\n## Plot the Barplot over the Reference Lines\nbarplot(df.final$index,\n add=T,\n col=heat.colors(9),\n yaxt=&apos;n&apos;,\n border=FALSE)\n\n## Bar Value Labels\ntext(chart.lbl.posx, chart.lbl.posy, chart.lbl.val.pace, col=&quot;black&quot;, cex=chart.in.textsize*chart.in.textscale)\ntext(chart.lbl.posx, chart.lbl.posy-0.4, chart.lbl.val.totaltime, col=&quot;black&quot;, cex=chart.in.textsize*chart.in.textscale)\n\n## Summary Box Labels\ntext(8.5, chart.summarybox.posy, chart.summarybox.text, cex=chart.in.textsize*chart.in.textscale, col=chart.in.chart.color1)\n\nprint(df.pheno)\nprint(df.final)\nprint(df.working)" />
<property name="state" type="QString" value="" />
<property name="plotOnChart" type="bool" value="0" />
<property name="showConsole" type="bool" value="0" />
</chart>
<chart id="39" name="" title="Tri Mix (R)" >
<property name="title" type="QString" value="Tri Mix (R)" />
<chart id="44" name="" title="Tri Mix" >
<property name="title" type="QString" value="Tri Mix" />
<property name="subtitle" type="QString" value="" />
<property name="widthFactor" type="double" value="2" />
<property name="heightFactor" type="double" value="2" />
<property name="style" type="int" value="0" />
<property name="resizable" type="bool" value="0" />
<property name="script" type="QString" value="## R-chart script.\n## For use with GoldenCheetah.\n## tested on GC.version() is &quot;DEV-V3.5 1705&quot;\n##\n\npie=TRUE ##FALSE\nsportlist=c(&quot;Swim&quot;,&quot;Bike&quot;, &quot;Run&quot;, &quot;Strength&quot;)\neco=c(3, 1/5, 1, 0)\ncolor=c(&quot;#578cb5&quot;,&quot;#85a67a&quot;, &quot;#ffaa7f&quot;,&quot;#ffd64d&quot;)\n\npar(mfrow=c(2,2), mar=c(3,3,3,3))\n##layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE), widths=c(1,1), heights=c(1,1))\n\n##Get metrics\nmetrics&lt;- GC.season.metrics(all=FALSE, filter=&quot;&quot;, compare=FALSE)\n\n##Filter Walks\n#metrics&lt;-metrics[metrics$Workout_Code!=&quot;Walk&quot;,]\n\n##Count Weeks\nweeks &lt;- 1\nif (length(metrics$date)&gt;0) {\n weeks &lt;- max( (as.numeric(metrics$date[length(metrics$date)]-metrics$date[1])+1)/7, 1)\n}\n\nmetriclist&lt;- c()\ntrg&lt;- c();time&lt;-c();distance&lt;-c()\nfor(a in 1:length(sportlist)) {\n metriclist[[a]]&lt;-metrics[which(metrics$Sport==sportlist[a]),]\n trg[a]&lt;-length(metriclist[[a]]$Sport)\n if (trg[a]&gt;0) {\n time[a]&lt;-Reduce(&quot;+&quot;,metriclist[[a]]$Duration)\n distance[a]&lt;-Reduce(&quot;+&quot;,metriclist[[a]]$Distance)\n } else {\n time[a]&lt;-0\n distance[a]&lt;-0\n }\n}\n\ntrg&lt;-trg/weeks\ntime[is.na(time)]&lt;-0\ntime&lt;-time%/%weeks\ndistance[is.na(distance)]&lt;-0\ndistance&lt;-distance/weeks\n\nheader1&lt;-sprintf(&quot;Activities (%.1f/wk)&quot;, sum(trg))\nheader2&lt;-sprintf(&quot;Duration (%d:%02d:%02d/wk)&quot;, sum(time)%/%3600, sum(time)%/%60%%60, sum(time)%%60)\nheader3&lt;-sprintf(&quot;Distance (ECO %.1f/wk)&quot;, sum(distance*eco))\n\nif (pie==TRUE){\n pie(trg, labels=sprintf(&quot;%s %.1f&quot;,sportlist,trg), main=header1, col=color)\n pie(time, labels=sprintf(&quot;%s %d:%02d:%02d&quot;,sportlist,time%/%3600,time%/%60%%60,time%%60), main=header2, col=color)\n pie(distance*eco, labels=sprintf(&quot;%s %.1f km (%.1f)&quot;,sportlist,distance,distance*eco), main=header3, col=color)\n plot.new()\n }else{\n barplot(trg, names.arg=sprintf(&quot;%s %.1f&quot;,sportlist,trg), main=header1, col=color, space=0, axes=FALSE)\n barplot(time, names.arg=sprintf(&quot;%s %d:%02d:%02d&quot;,sportlist,time%/%3600,time%/%60%%60,time%%60), main=header2, col=color, space=0, axes=FALSE)\n barplot(distance*eco, names.arg=sprintf(&quot;%s %.1f&quot;,sportlist,distance), main=header3, col=color, space=0, axes=FALSE)\n plot.new()\n }\n\ntitle&lt;-sprintf(&quot;%s (%.1f weeks)&quot;, GC.season()$name, weeks)\nlegend(x=&quot;center&quot;, title=title, legend=sportlist, fill=color, border=&quot;white&quot;, cex=2, bty=&quot;n&quot;)\n##plot.new()\n" />
<property name="script" type="QString" value="\n\n## R (Daimon) -&gt; Python (Fe)\n##.....................................................\n##.....................................................\n##\n## R-chart script.\n## Chart: SS-SR\n## Creator: Daimon\n##\n## For use with GoldenCheetah.\n## tested on GC.version() is &quot;DEV-V3.5 1705&quot;\n##\n## .................................................\n##\n## Tri Mix\n## Last Edited At: 2017-09-26 - Creator: Daimon\n## Triathlon\n## Chart to display the relation between Swim-Bike-Run in the selected Data Range as\n## function of activities / duration / distance.\n\n## Default graph is pie chart.\n## (in script &quot;pie=TRUE&quot; displays pie charts, &quot;pie=FALSE&quot; displays bar graph)\n\n## Remark:\n## if the triathlon sports are not defined as the default English &quot;Swim&quot;,&quot;Bike&quot;,&quot;Run&quot; then change the names accoordingly in the script &quot;sportlist=c(&quot;Swim&quot;,&quot;Bike&quot;,&quot;Run&quot;)&quot;\n## \n##.....................................................\n##\n## Python script\n## Chart: Py_tri_mix_01 (cover R tri mix)\n## Creator: Fe \n##\n## GC.version() &quot;V3.6-RC1&quot; (Build id: 4010 2022/07/04)\n##\n## 08&apos;2022\n## Python Script \n##\n## Python1: pre-installed (Build id: 4010 2022/07/04)\n## Plotly1: pre-installed (Build id: 4010 2022/07/04)\n##\n## Python2: 3.7.9 (Aug 17 2020)\n## Plotly2: 4.6.0 --&gt; 5.2.1\n##\n## Golden Cheetah: &quot;V3.6-RC1&quot; (Build id: 4010 2022/07/04)\n## Trends\n##\n##.....................................................\n\n\n## packages\nimport numpy as np\nimport plotly as ply\nimport datetime\nimport tempfile\nimport pathlib\nfrom plotly import tools\nimport plotly.graph_objs as go\n\n#......................................................\n\ntemp_file = tempfile.NamedTemporaryFile(mode=&quot;w+t&quot;, prefix=&quot;GC_&quot;, suffix=&quot;.html&quot;, delete=False)\n\n#......................................................\n\npie=True## False\n\nsportlist=[&quot;Swim&quot;,&quot;Bike&quot;,&quot;Run&quot;]\n\ncolor=[&apos;rgb(87,140,181)&apos;,&apos;rgb(255, 153, 0)&apos;,&apos;rgb(133,166,122)&apos;]\n#&apos;rgb(255,214,77)&apos;\n\nheader1=&apos;Activities&apos; #&quot;\nheader2=&apos;Duration (h:mm:ss)&apos;\nheader3=&apos;Distance (km)&apos;\nheader4=&apos;Normalized effort (%)&apos; ##???\npaper_bgcolor=&apos;rgb(20,20,20)&apos;\nplot_bgcolor=&apos;rgb(20,20,20)&apos;\n\nmetrics=GC.seasonMetrics(all=False, filter=&apos;&apos;, compare=False)\ntrg=[];time=[];distance=[]\n\nfor sport_name in sportlist:\n filter=np.array(metrics[&apos;Sport&apos;])==[sport_name]\n trg.append(len(np.array(metrics[&apos;Duration&apos;])[filter]))\n time.append(np.sum(np.array(metrics[&apos;Duration&apos;])[filter]))\n distance.append(np.sum(np.array(metrics[&apos;Distance&apos;])[filter]))\n\n\n## trg=[50,70,35] ## random values, only for plot jpg\n## time=[70000,158529,45000] ## random values, only for plot jpg\n## distance=[100,1000,450] ## random values, only for plot jpg\n\n\ndef hms(seconds):\n h = int(seconds // 3600)\n m = int(seconds % 3600 // 60)\n s = int(seconds % 3600 % 60)\n return &apos;{:02d}:{:02d}:{:02d}&apos;.format(h, m, s)\n\ntime_hms=[hms(sec) for sec in time]\n\ntrace=[];layout=[]\n\nif pie:\n trace1 = dict(\n values=trg,\n marker=dict(colors=color),labels=sportlist,textfont=dict(size=13,color=&apos;white&apos;),\n type=&apos;pie&apos;,\n hoverinfo=&apos;label+percent&apos;,textinfo=&apos;value+label&apos;,textposition=&apos;outside&apos;,\n #domain=dict(column=0,row=0),\n domain=dict(x=[0,0.49],y=[0.55,1])\n )\n trace.append(trace1)\n\n trace2 = dict(\n values=time,\n marker=dict(colors=color),labels=sportlist,textfont=dict(size=13,color=&apos;white&apos;),\n type=&apos;pie&apos;,\n text=time_hms,#[hms(sec) for sec in time],\n hoverinfo=&apos;percent+label&apos;,textinfo=&apos;text+label&apos;,textposition=&apos;outside&apos;,\n #domain=dict(column=1,row=0),\n domain=dict(x=[0.51,1.0],y=[0.55,1])\n )\n trace.append(trace2)\n\n trace3 = dict(\n values=np.round(distance,2),\n marker=dict(colors=color),labels=sportlist,textfont=dict(size=13,color=&apos;white&apos;),\n type=&apos;pie&apos;,\n hoverinfo=&apos;label+percent&apos;,textinfo=&apos;value+label&apos;,textposition=&apos;outside&apos;,\n #domain=dict(column=0,row=1)\n domain=dict(x=[0,0.49],y=[0,0.45])\n )\n trace.append(trace3)\n\n grid_data=[[0.25,1.05,header1,&apos;orange&apos;],[0.8,1.05,header2,&apos;orange&apos;],[0.25,0.5,header3,&apos;orange&apos;],[0.8,0.4,&apos;Sport&apos;,&apos;lightgreen&apos;]]\n\n grid_title=[dict(x=a,y=b,text=c,showarrow=False,xanchor=&apos;center&apos;,font=dict(color=d,size=15)) for a,b,c,d in grid_data]\n\n layout=dict(title=&apos;Tri mix&apos;,titlefont=dict(size=18,color=&apos;rgb(243,218,11)&apos;),paper_bgcolor=paper_bgcolor,plot_bgcolor=plot_bgcolor,grid=dict(rows=2,columns=2),#columns=2),\n legend=dict(x=0.8,y=0.25,xanchor=&quot;center&quot;,font=dict(color=&apos;white&apos;)),\n annotations=grid_title\n )\n\nelse:\n\n trace1 = dict(\n x=sportlist,y=trg,\n name=header1,\n text=trg,marker=dict(color=color),textfont=dict(size=14,color=&apos;white&apos;),\n type=&apos;bar&apos;,\n xaxis=&apos;x1&apos;,yaxis=&apos;y1&apos;,\n )\n trace.append(trace1)\n\n trace2 = dict(\n x=sportlist,y=time,\n name=header2,\n text=time_hms,marker=dict(color=color),textfont=dict(size=14,color=&apos;white&apos;),\n type=&apos;bar&apos;,\n xaxis=&apos;x2&apos;,yaxis=&apos;y2&apos;,\n )\n trace.append(trace2)\n\n trace3 = dict(\n x=sportlist,y=np.round(distance,2),\n name=header3,\n text=np.round(distance,2),marker=dict(color=color),textfont=dict(size=14,color=&apos;white&apos;),\n type=&apos;bar&apos;,\n xaxis=&apos;x3&apos;,yaxis=&apos;y3&apos;,\n )\n trace.append(trace3)\n\n trace4 = dict(\n x=[0,1],y=[0,1],mode=&quot;lines&quot;,line=dict(color=plot_bgcolor),\n xaxis=&apos;x4&apos;,yaxis=&apos;y4&apos;,\n )\n trace.append(trace4)\n\n\n axis=dict(\n showline=False,zeroline=False,showgrid=False,mirror=False,tickfont=dict(size=11,color=&apos;lightgrey&apos;))\n \n grid_data=[[len(trg)/3,max(trg)*1.08,header1,&apos;orange&apos;,&apos;x1&apos;,&apos;y1&apos;],[len(time)/3,max(time)*1.08,header2,&apos;orange&apos;,&apos;x2&apos;,&apos;y2&apos;],[len(distance)/3,max(distance)*1.08,header3,&apos;orange&apos;,&apos;x3&apos;,&apos;y3&apos;]]#,[1/2,1/2,&apos;Sport&apos;,&apos;lightgreen&apos;,&apos;x4&apos;,&apos;y4&apos;]]\n\n grid_title=[dict(x=a,y=b,text=c,xref=e,yref=f,showarrow=False,font=dict(color=d,size=14)) for a,b,c,d,e,f in grid_data]\n\n grid_data_4=[[1/2,1/1.2,&apos;Sport :&apos;,&apos;white&apos;,&apos;x4&apos;,&apos;y4&apos;,17,&apos;left&apos;],[1/2,1/1.4,&apos;- &apos;+str(sportlist[0]),color[0],&apos;x4&apos;,&apos;y4&apos;,15,&apos;left&apos;],[1/2,1/1.6,&apos;- &apos;+str(sportlist[1]),color[1],&apos;x4&apos;,&apos;y4&apos;,15,&apos;left&apos;],[1/2,1/1.9,&apos;- &apos;+str(sportlist[2]),color[2],&apos;x4&apos;,&apos;y4&apos;,15,&apos;left&apos;]]\n\n grid_title_4=[dict(x=a,y=b,text=c,xref=e,yref=f,showarrow=False,font=dict(color=d,size=g),xanchor=h) for a,b,c,d,e,f,g,h in grid_data_4]\n \n\n layout=dict(\n title=&apos;Tri mix&apos;,titlefont=dict(size=18,color=&apos;rgb(243,218,11)&apos;),\n paper_bgcolor=paper_bgcolor,plot_bgcolor=plot_bgcolor,bargap=0,showlegend=False,\n xaxis1=dict(axis,**dict(domain=[0.0,0.45], anchor=&apos;y1&apos;)),\n xaxis2=dict(axis,**dict(domain=[0.55, 1.0], anchor=&apos;y2&apos;)),\n xaxis3=dict(axis,**dict(domain=[0.0, 0.45],anchor=&apos;y3&apos;)),\n xaxis4=dict(axis,**dict(domain=[0.55, 1.0],anchor=&apos;y4&apos;,showticklabels=False)), \n yaxis1=dict(axis,**dict(domain=[0.55, 1.0], anchor=&apos;x1&apos;,showticklabels=False)),\n yaxis2=dict(axis,**dict(domain=[0.55,1.0], anchor=&apos;x2&apos;,showticklabels=False)),\n yaxis3=dict(axis,**dict(domain=[0.0, 0.45], anchor=&apos;x3&apos;,showticklabels=False)),\n yaxis4=dict(axis,**dict(domain=[0.0, 0.45], anchor=&apos;x4&apos;,showticklabels=False)),\n #legend=dict(x=0.8,y=0.15,xanchor=&quot;center&quot;,font=dict(color=&apos;white&apos;)),\n annotations=grid_title+grid_title_4\n )\n\n\n\nfig = dict(data=trace, layout=layout)\n\nply.offline.plot(fig,auto_open = False, filename=temp_file.name, validate=False)\n\nGC.webpage(pathlib.Path(temp_file.name).as_uri())\n\n\n\n" />
<property name="state" type="QString" value="" />
<property name="plotOnChart" type="bool" value="0" />
<property name="showConsole" type="bool" value="0" />
<property name="asWeb" type="bool" value="1" />
</chart>
</layout>
<layout name="Measures" style="0" type="8" expression="" trainswitch="0">
Expand Down