forked from justdark/dvisual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_old_struct.html
executable file
·100 lines (73 loc) · 14.2 KB
/
test_old_struct.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<body>
<meta charset="UTF-8">
<canvas id="RetinaJudge" height="400px" width ="400px"></canvas>
<canvas id="myCanvas" height="400px" width ="400px"></canvas>
<canvas id="myCanvas1" height="400px" width ="400px"></canvas>
<canvas id="myCanvas2" height="400px" width ="400px"></canvas>
<canvas id="myCanvas3" height="400px" width ="500px"></canvas>
<canvas id="myCanvas4" height="400px" width ="400px"></canvas>
<canvas id="myCanvas5" height="400px" width ="400px"></canvas>
<canvas id="myCanvas6" height="450px" width ="400px"></canvas>
<canvas id="myCanvas7" height="400px" width ="400px"></canvas>
<canvas id="myCanvas8" height="400px" width ="600px"></canvas>
<canvas id="myCanvas9" height="400px" width ="500px"></canvas>
<canvas id="myCanvas10" height="400px" width ="600px"></canvas>
</table>
</body>
<script type="text/javascript" src="dv.js">
</script>
<script type="text/javascript">
var test = new DVcanvas("myCanvas");
//test.draw();
test.drawAxes("天气","号码sssssssssss");
//test.Dot(100,100,'rgb(256,0,0)');
//test.rect(20,20,40,40);
//test.rect(40,40,90,90);
//test.fillRect(40,40,90,90,'rgba(0,256,0,0.5)');
//test.linePath([1,2,3,4,5,6,7,8],[1,4,8,16,25,36,72,144],'#0F0');
test.linePath([0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9],[9.13090620029994, 7.118300004364756, 8.64075587951997, 9.710416441115218, 9.322846742922088, 9.056150136621335, 9.108101564537487, 8.45509698625086, 8.736924245835883, 7.606032672634812, 8.472099236483583, 9.649924244748698, 5.489023620765848, 6.690238017789536, 8.927546999917414, 9.111519664637672, 5.904779569425021, 6.780722878295234, 9.945332217015842, 7.501304076985086, 6.082375428413196, 6.57377277146206, 8.274120012523575, 8.515875409971441, 6.299972235660604, 5.340470072916613, 9.28998344449515, 6.188764358552173, 6.182738909396689, 8.67827861163249, 7.07119639776137, 9.889709178650673, 6.290422354938657, 7.046146905262395, 6.23061670372797, 6.317085843673329, 8.309873819045226, 5.575082261697132, 6.307515915568937, 5.547239649724286, 7.305925134529345, 8.746560085903551, 5.533181502797484, 9.761626578912853, 8.923356053583273, 7.985761119072953, 5.737691237086597, 5.8199601865342405, 7.759143636641751, 6.1896422735808265, 7.6918797363317895, 5.811659272940641, 7.996245645380639, 6.3542735782532365, 9.482769458131678, 6.256515633074864, 9.1189471069112, 7.042961732062109, 7.3515458801854106, 5.714510448941691, 7.448124222844859, 7.438814924844461, 5.978770753259722, 8.092623691039387, 6.630849003048162, 8.060724433470916, 5.119396558625851, 9.72884812447111, 9.841723919560728, 6.710031704591236, 6.73252767860526, 6.897608624985936, 5.9542512922369015, 5.3824047839578455, 9.643712606643193, 7.18175836750534, 8.646294410555333, 8.217995263080937, 6.480223580707265, 9.110910334369457, 8.562243378764022, 8.56430945969737, 6.885171824616584, 5.1601746219124065, 6.651662757371544, 8.1564707951565, 5.691161264861341, 5.111805073632494, 7.528182442056384, 5.078872201678394, 5.935293490691965, 8.088370241340872, 5.137356502438488, 7.090546858086129, 7.178951275165159, 6.8952735922524635, 9.493715613322806, 6.563386553133646, 8.684211353694348, 8.267582158760106],'#F00',0);
var test1 = new DVcanvas("myCanvas1");
//test.draw();
test1.drawAxes(0,0);
test1.DotChart([0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9],[10.0, 9.604000000000003, 9.216, 8.836000000000002, 8.463999999999999, 8.1, 7.744000000000001, 7.395999999999999, 7.056, 6.724, 6.4, 6.084, 5.776, 5.476, 5.184000000000001, 4.9, 4.624, 4.356, 4.096000000000001, 3.8440000000000003, 3.6, 3.364, 3.1359999999999997, 2.9160000000000004, 2.704, 2.5, 2.304, 2.1159999999999997, 1.9360000000000002, 1.764, 1.6, 1.444, 1.2959999999999996, 1.1560000000000001, 1.0240000000000002, 0.9, 0.7839999999999999, 0.6759999999999998, 0.5760000000000002, 0.48400000000000004, 0.4, 0.3240000000000003, 0.2559999999999999, 0.19600000000000012, 0.14399999999999985, 0.1, 0.06400000000000011, 0.03599999999999996, 0.016000000000000028, 0.0039999999999999715, 0.0, 0.0039999999999999715, 0.016000000000000028, 0.03599999999999996, 0.06400000000000011, 0.1, 0.14399999999999985, 0.19600000000000012, 0.2559999999999999, 0.3240000000000003, 0.4, 0.4839999999999997, 0.5760000000000002, 0.6759999999999998, 0.7840000000000005, 0.9, 1.0239999999999996, 1.1560000000000001, 1.2959999999999996, 1.4440000000000004, 1.6, 1.7639999999999991, 1.9360000000000002, 2.1159999999999997, 2.3040000000000007, 2.5, 2.7039999999999993, 2.9160000000000004, 3.1359999999999997, 3.3640000000000008, 3.6, 3.8439999999999994, 4.095999999999998, 4.356000000000002, 4.6240000000000006, 4.9, 5.183999999999998, 5.475999999999998, 5.776000000000002, 6.0840000000000005, 6.4, 6.724, 7.0559999999999965, 7.396000000000003, 7.744000000000001, 8.1, 8.463999999999999, 8.835999999999997, 9.216000000000003, 9.604000000000003],'#F00');
var test2 = new DVcanvas("myCanvas2");
test2.drawAxes(0,0);
test2.DrawBar(["Today","Tomm","Sam","BBBBBBBB"],[5,9,4,8]);
//test.DrawBar(["Today","Tomm","Sam","BBBBBBBB"],[2,2,2,2],2,2,"#F00");
var test3 = new DVcanvas("myCanvas3");
test3.drawAxes("","高度");
//test.DrawMulBar(["Today","Tomm","Sam","BBBBBBBB"],[[12,2],[4,2],[6,3],[15,13]],["TTT","BBB"]);
test3.DrawMulBar(["Today","Tomm","Sam","BBBBBBBB"],[[12,2,4],[4,2,7],[6,3,9],[15,13,5]],["TTT","BBB","QQQQQ"]);
//test3.DrawMulBar(["Today","Tomm","Sam","BBBBBBBB"],[[12.2,12.3,12.4],[12.4,12.2,12.7],[12.6,12.3,12.9],[12.5,12.3,12.5]],["TTT","BBB","QQQQQ"]);
var test4 = new DVcanvas("myCanvas4");
test4.drawAxes(0,0);
//test4.DrawHist([1,2,3,4,5,6,7,8,9,0,2,3,4,5,6,7,8,9,3,4,5,6,7,4,5,6,4,4,5,6],0,1);
test4.DrawHist([4.845526425588935, 4.259344936827764, 3.8098053040235538, 1.952000211472447, 4.635797415383389, 4.024019790968537, 3.3602908242946734, 5.904528760874355, 4.198898591038685, 3.590128975916881, 4.332713128186926, 3.1865396813511784, 2.5162865661667198, 4.712821025260148, 3.71360994330834, 3.8493524061913744, 3.7159258918857536, 5.51399789047954, 3.6300232108929382, 3.545076471891732, 3.0676446553817147, 3.2444930114999093, 3.5479330646839933, 4.976746738515327, 3.9332813190873934, 5.006312033998867, 3.404727953308918, 3.5033407619438233, 3.079551989356432, 3.8632840581876042, 3.157986089467415, 3.4195326824382866, 3.8080356643280124, 2.957309227091329, 4.118392736251364, 3.6411410599078917, 3.7624757886685964, 4.8647889699576226, 5.21796736714372, 3.976067213322964, 5.126928746440573, 3.974656703704623, 3.233580498913617, 4.395312593899124, 4.068962687058488, 3.891929789953702, 4.469243993566407, 4.334454703693426, 3.9209889294562856, 3.4434304992247453, 4.497549493028219, 3.416343894896489, 4.665283209646114, 4.680609105269387, 4.983997832840491, 3.6712180044043317, 3.265064804033842, 3.4698542145767295, 3.600410757683259, 3.258705331315113, 3.4711330714824475, 5.850035283124024, 4.4280162444420395, 2.9032881754752737, 3.8438971175165753, 4.876106607781984, 2.558687703308084, 3.5013932005344044, 3.5555419525521454, 5.1907150725045845, 4.011722379620389, 3.527897189378135, 4.10495828533477, 6.62176464809461, 4.2726902430636144, 3.900071148628866, 2.575252541466217, 5.328266087881893, 2.5589399335225336, 5.724120236174612, 4.4515392634560085, 4.7151321389757594, 2.8531894976428953, 3.4703243319242265, 2.2640882905146724, 5.0719845838182795, 3.574145032952119, 4.477360695988922, 5.779618114520955, 4.456319741265055, 3.8274174274387756, 6.050865845999171, 5.286157426108568, 4.197556181625366, 3.2386132037552726, 4.409816073319034, 4.225877761979799, 5.313407146149141, 5.042124222577709, 3.979632468039347],0,0.5);
var test5 = new DVcanvas("myCanvas5");
//test4.DrawHist([1,2,3,4,5,6,7,8,9,0,2,3,4,5,6,7,8,9,3,4,5,6,7,4,5,6,4,4,5,6],0,1);
test5.DrawPie(["星期一","星期二","星期四","周末","周三","周五","周六"],[2,3,6,8,3,6,8]);
var RetinaJudge = document.getElementById("RetinaJudge");
RetinaJudge = RetinaJudge.getContext('2d');
RetinaJudge.rect(20,20,200,200);
RetinaJudge.moveTo(20,20);
RetinaJudge.lineTo(220,220);
RetinaJudge.stroke();
//arcFilltext(RetinaJudge,"YYYYYYYYY",100,100,Math.PI/4)
var test6 = new DVcanvas("myCanvas6");
//alert(test6.sortXY([3,1,2,4,5],[3,1,2,4,5]));
//test4.DrawHist([1,2,3,4,5,6,7,8,9,0,2,3,4,5,6,7,8,9,3,4,5,6,7,4,5,6,4,4,5,6],0,1);
test6.DrawRadar(["型号1","型号2"],[[6,7,3,5,6,9],[8,6,7,2,8,6]],["速度","能力","强度","战斗力","成本","价格"],0,10);
var test7 = new DVcanvas("myCanvas7");
test7.drawAxes("天气","号码sssssssssss");
test7.MulLinePath([[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9],[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9],[0,10]],[[10.0, 9.604000000000003, 9.216, 8.836000000000002, 8.463999999999999, 8.1, 7.744000000000001, 7.395999999999999, 7.056, 6.724, 6.4, 6.084, 5.776, 5.476, 5.184000000000001, 4.9, 4.624, 4.356, 4.096000000000001, 3.8440000000000003, 3.6, 3.364, 3.1359999999999997, 2.9160000000000004, 2.704, 2.5, 2.304, 2.1159999999999997, 1.9360000000000002, 1.764, 1.6, 1.444, 1.2959999999999996, 1.1560000000000001, 1.0240000000000002, 0.9, 0.7839999999999999, 0.6759999999999998, 0.5760000000000002, 0.48400000000000004, 0.4, 0.3240000000000003, 0.2559999999999999, 0.19600000000000012, 0.14399999999999985, 0.1, 0.06400000000000011, 0.03599999999999996, 0.016000000000000028, 0.0039999999999999715, 0.0, 0.0039999999999999715, 0.016000000000000028, 0.03599999999999996, 0.06400000000000011, 0.1, 0.14399999999999985, 0.19600000000000012, 0.2559999999999999, 0.3240000000000003, 0.4, 0.4839999999999997, 0.5760000000000002, 0.6759999999999998, 0.7840000000000005, 0.9, 1.0239999999999996, 1.1560000000000001, 1.2959999999999996, 1.4440000000000004, 1.6, 1.7639999999999991, 1.9360000000000002, 2.1159999999999997, 2.3040000000000007, 2.5, 2.7039999999999993, 2.9160000000000004, 3.1359999999999997, 3.3640000000000008, 3.6, 3.8439999999999994, 4.095999999999998, 4.356000000000002, 4.6240000000000006, 4.9, 5.183999999999998, 5.475999999999998, 5.776000000000002, 6.0840000000000005, 6.4, 6.724, 7.0559999999999965, 7.396000000000003, 7.744000000000001, 8.1, 8.463999999999999, 8.835999999999997, 9.216000000000003, 9.604000000000003],[1.25, 1.2005000000000003, 1.152, 1.1045000000000003, 1.0579999999999998, 1.0125, 0.9680000000000002, 0.9244999999999999, 0.882, 0.8404999999999999, 0.8, 0.7605, 0.722, 0.6845000000000001, 0.648, 0.6125, 0.578, 0.5445, 0.5120000000000001, 0.48050000000000004, 0.45, 0.4205, 0.39199999999999996, 0.36450000000000005, 0.338, 0.3125, 0.288, 0.26449999999999996, 0.24200000000000005, 0.2205, 0.2, 0.1805, 0.16199999999999998, 0.14450000000000002, 0.12800000000000003, 0.1125, 0.09799999999999999, 0.08449999999999998, 0.07200000000000002, 0.06050000000000001, 0.05, 0.04050000000000003, 0.03199999999999999, 0.024500000000000015, 0.01799999999999998, 0.0125, 0.008000000000000014, 0.004499999999999995, 0.0020000000000000035, 0.0004999999999999964, 0.0, 0.0004999999999999964, 0.0020000000000000035, 0.004499999999999995, 0.008000000000000014, 0.0125, 0.01799999999999998, 0.024500000000000015, 0.03199999999999999, 0.04050000000000003, 0.05, 0.060499999999999964, 0.07200000000000002, 0.08449999999999998, 0.09800000000000006, 0.1125, 0.12799999999999995, 0.14450000000000002, 0.16199999999999998, 0.18050000000000005, 0.2, 0.22049999999999992, 0.24200000000000005, 0.26449999999999996, 0.2880000000000001, 0.3125, 0.3379999999999999, 0.36450000000000005, 0.39199999999999996, 0.4205000000000001, 0.45, 0.48049999999999987, 0.5119999999999998, 0.5445000000000002, 0.5780000000000001, 0.6125, 0.6479999999999999, 0.6844999999999997, 0.7220000000000002, 0.7605000000000002, 0.8, 0.8404999999999999, 0.8819999999999997, 0.9245000000000003, 0.9680000000000002, 1.0125, 1.0579999999999998, 1.1044999999999996, 1.1520000000000004, 1.2005000000000003],[0,10]],["Line1","Lisssssssne2","sssss"],0,1,0);
var test8 = new DVcanvas("myCanvas8");
test8.drawAxes("天气","时间 (hours)");
test8.DrawStackBar(["星期一","星期二","星期三","星期四","星期五","周六","周末"],[[2,3,6],[3,4,3],[5,3,2],[4,4,1],[2,3,5],[3,3,3],[4,2,4]],["吃饭","读书","睡觉"],["rgba(55,185,241,0.3)","rgba(207,231,62,0.3)","rgba(216,121,121,0.3)"]);
var test9 = new DVcanvas("myCanvas9");
test9.drawAxes("温度","湿度");
test9.BubbleChart([1,2,3,4,5,6,7],[1,2,3,4,5,6,7],[1,2,3,4,5,6,7],["A","B","C","D","E","F","G"]);
var test10 = new DVcanvas("myCanvas10");
test10.drawAxes("温度","湿度");
test10.MulBubbleChart([[1,2,3,4,5,6,7],[3,6,4,2,5,8,9]],[[1,2,3,4,5,6,7],[4,2,3,7,4,6,1]],[[1,2,3,4,5,6,7],[2,3,5,8,3,6,9]],0,["发达国家","发展中国家"]);
//test.rect(1,1,2,2)
</script>