Rev 12488 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10069 | bpr | 1 | |
9355 | bpr | 2 | !if $datay=$empty |
9358 | bpr | 3 | !exit |
9355 | bpr | 4 | !endif |
9604 | bpr | 5 | !distribute item 30,0,14,0,lightgrey,lightgrey,blue,darkgreen,darkgreen,orange,grey, into lim,testfin,\ |
9410 | bpr | 6 | noactivity,noday,\ |
9604 | bpr | 7 | colorgrid,colorgridm,color,colorg,colorgraph,colorgraph1,colorbreak,rupture |
9405 | bpr | 8 | !if $datanew!=$empty |
12488 | bpr | 9 | !set test=!text select 123456789 in $datanew |
10 | !if $test=$empty |
||
11 | !reset datanew |
||
12 | !endif |
||
9405 | bpr | 13 | !endif |
14 | !if $datanew!=$empty |
||
15 | !set maxexo=!exec pari vecmax([$datay,$datanew,7])+1 |
||
16 | !else |
||
17 | !set maxexo=!exec pari vecmax([$datay,7])+1 |
||
18 | !endif |
||
19 | !reset barchart linegraph legend goodlist linegraph1 |
||
9365 | bpr | 20 | !set dataxcnt=!itemcnt $datax |
21 | !for j=1 to $dataxcnt |
||
22 | !set cnt=$(datax[$j]) |
||
9355 | bpr | 23 | !set cnt1=!char 1 to 4 of $cnt |
24 | !set cnt2=!char 5 to 6 of $cnt |
||
25 | !set cnt3=!char 7 to 8 of $cnt |
||
9365 | bpr | 26 | !set jday_=$(day[$j]) |
9410 | bpr | 27 | !if $j>1 and $[$jday_ - $(day[$j-1])+1] > $noactivity |
28 | !set noday_=$[7*floor(($jday_ -$(day[$j-1]))/7)] |
||
9431 | bpr | 29 | !set noday=$[$noday + $noday_] |
9413 | bpr | 30 | !set rupture=!append line frectangle $[$jday_ - $noday],-3,$[$jday_ - $noday+6],$[$maxexo],$colorbreak\ |
9414 | bpr | 31 | text black, $[$jday_ - $noday+2],-1.5,,$noday_ $name_days\ |
32 | arrow2 $[$jday_ - $noday],-2.5,$[$jday_ - $noday+6],-2.5,6,black\ |
||
9410 | bpr | 33 | to $rupture |
9431 | bpr | 34 | !set noday=$[$noday -7] |
9410 | bpr | 35 | !endif |
9414 | bpr | 36 | !if $noday!=0 |
9431 | bpr | 37 | !set jday_=$[$jday_ - $noday] |
9414 | bpr | 38 | !endif |
9365 | bpr | 39 | !set tmp=$[min($(datay[$j]),$maxexo)] |
9380 | bpr | 40 | !set barchart=!append colon $jday_:$tmp:$color to $barchart |
10069 | bpr | 41 | !!set linegraph=!append colon $jday_:$(dataz[$j]) to $linegraph |
9405 | bpr | 42 | !if $(datanew[$j])!=$empty |
12488 | bpr | 43 | !!set linegraph1=!append colon $jday_:$(datanew[$j]) to $linegraph1 |
44 | !if $(datanew[$j])>0 |
||
45 | !set linegraph1=!append line segment $[$jday_+0.5],0,$[$jday_+0.5],$(datanew[$j]),$colorgraph1 to $linegraph1 |
||
46 | !endif |
||
9405 | bpr | 47 | !endif |
9380 | bpr | 48 | !set legend=!append colon $jday_:$cnt3/$cnt2 to $legend |
9365 | bpr | 49 | !set good=!declosing $(datagood[$j]) |
50 | !set good=!nonempty items $good |
||
51 | !if $good!=$empty |
||
12488 | bpr | 52 | !set gcnt=!itemcnt $good |
53 | !set good=!makelist $jday_,x for x in $good |
||
54 | !if $gcnt > $lim |
||
55 | !for t=0 to $[floor($gcnt/$lim)-1] |
||
56 | !set goodlist=!append line crosshairs,$colorg,$(good[$[2*$t*$lim+1]..$[2*($t+1)*$lim]]) to $goodlist |
||
57 | !next |
||
58 | !if $[2*$t*$lim] < [2*$gcnt] |
||
59 | !set goodlist=!append line crosshairs,$colorg,$(good[$t*2*$lim+1..-1]) to $goodlist |
||
60 | !endif |
||
61 | !else |
||
62 | !set goodlist=!append line crosshairs,$colorg,$good to $goodlist |
||
9355 | bpr | 63 | !endif |
64 | !endif |
||
65 | !if $jday_ > $maxday |
||
12488 | bpr | 66 | !break |
9355 | bpr | 67 | !endif |
68 | !next |
||
9365 | bpr | 69 | !if $barchart=$empty |
12488 | bpr | 70 | !exit |
9365 | bpr | 71 | !endif |
72 | |||
73 | !set testfin=$[$jday_+2] |
||
9405 | bpr | 74 | !if $testfin < 100 |
9358 | bpr | 75 | !set mult=10 |
9355 | bpr | 76 | !else |
9405 | bpr | 77 | !set mult=8 |
9355 | bpr | 78 | !endif |
9365 | bpr | 79 | !distribute item $[$testfin*$mult],$[$maxexo*$mult] into xsize, ysize |
9355 | bpr | 80 | |
81 | !exec canvasdraw\ |
||
82 | size $xsize,$ysize\ |
||
83 | xrange -2,$[$testfin]\ |
||
9414 | bpr | 84 | yrange -4,$maxexo\ |
9355 | bpr | 85 | axis\ |
9405 | bpr | 86 | fontsize 8\ |
9355 | bpr | 87 | xaxisup $legend\ |
88 | ylabel $name_ylabel\ |
||
9405 | bpr | 89 | legend $lastname $(datax[1])-$(datax[-1])\ |
90 | opacity 255,40\ |
||
9604 | bpr | 91 | grid 7,10,$colorgrid,7,10,0,$colorgridm\ |
9355 | bpr | 92 | barchart $barchart\ |
10069 | bpr | 93 | linewidth 2\ |
9405 | bpr | 94 | crosshairsize $[rint($mult/3)]\ |
9355 | bpr | 95 | $goodlist\ |
10069 | bpr | 96 | linewidth 3\ |
9405 | bpr | 97 | $linegraph1\ |
10069 | bpr | 98 | comment strokecolor $colorgraph\ |
99 | comment linegraph $linegraph\ |
||
9410 | bpr | 100 | $rupture |
9355 | bpr | 101 | |
102 | !exit |
||
9358 | bpr | 103 | |
9355 | bpr | 104 | !set xsize_gnuplot_mult=$[round(10*$xsize/500)/10] |
105 | !set ysize_gnuplot_mult=$[round(10*$ysize/400)/10] |
||
106 | !set insplot_set=grid;title "$name_student($datafirst ..)";format x;size $xsize_gnuplot_mult,$ysize_gnuplot_mult; |
||
107 | !set insplot_transparent=white |
||
108 | !set insplot_set=$(insplot_set)boxwidth 0.4;style fill solid 1.0;timefmt "%y:%m:%d";xtics ($tics) rotate;xrange [0:$testfin];yrange [0:$maxexo]; |
||
109 | !insplot "insplot_data" using 1:2 with boxes notitle |