//count region on the datum, where draw "x0" line if(countX < 13) countX = 13; var scaleX = document.body.clientWidth - 60; var weightX = scaleX/countX; var zeroX = 30; //****************************************** var scaleY = document.body.clientHeight - 60; if(mint > -0.5) { var countY = 1.2*maxt; if(countY < 15) { maxt = 15/1.1;//for nice form countY = 15; } var weightY = scaleY/countY; var zeroY = scaleY-10; } else { if(maxt > 0.5) { var countY = 1.2*(maxt - mint); if(countY < 15) { maxt = (maxt/countY)*15*1.1;//для красоты mint = (mint/countY)*15*1.1; countY = 15; } var weightY = scaleY/countY; //+mint*weightY because mint is negative value var zeroY = scaleY+mint*weightY-10; } else { var countY = -1.2*mint; if(countY < 15) { maxt = 0; mint = -15/1.1; countY = 15; } var weightY = scaleY/countY; //+mint*weightY because mint is negative value var zeroY = scaleY+mint*weightY-10; } } var x = 0; var y = 0; var pix = ""; /* pix = "<v:line style=\"position:absolute;left:100px;top:100px\""+ "strokecolor=\"red\" strokeweight=\"2px\" from=\"0 0\" to=\"100 0\"/>"; document.write(pix); */
//————————--draw datum lines——————————————- for(var i=0;i<scaleY+15;i++) { x = zeroX; y = 25+scaleY-i; pix = "<div style=\"position:absolute;top:"+y+"px;left:"+x+"px;font-size:15pt;\">|</div>"; document.write(pix); } for(var i=0;i<scaleX+20;i++) { x = 10+i; y = Math.floor(zeroY); pix = "<div style=\"position:absolute;top:"+y+"px;left:"+x+"px;font-size:15pt;\">-</div>"; document.write(pix); } //————————--write datum values——————————————- if(mint > -1) { for(var i=0;i<Math.floor(1.1*maxt);i+=Math.floor(countY/7)) { y = Math.floor(zeroY-weightY*i); pix = "<div style=\"position:absolute;top:"+y+"px;left:5px;font-size:9px;font-family: Verdana, Arial, Helvetica, sans-serif;\">"+i+"</div>"; document.write(pix); pix = "<div style=\"position:absolute;top:"+y+"px;left:30px;font-size:15pt;\">-</div>"; document.write(pix); } } else { for(var i=Math.floor(1.1*mint);i<Math.floor(1.1*maxt);i+=Math.floor(countY/7)) { y = Math.floor(zeroY-weightY*i); pix = "<div style=\"position:absolute;top:"+y+"px;left:5px;font-size:9px;font-family: Verdana, Arial, Helvetica, sans-serif;\">"+i+"</div>"; document.write(pix); pix = "<div style=\"position:absolute;top:"+y+"px;left:30px;font-size:15pt;\">-</div>"; document.write(pix); } } for(var i=Math.floor(countX/6.2);i<countX;i+=Math.floor(countX/6.2)) { x = Math.floor(zeroX+weightX*i-105); y = Math.floor(zeroY+25); if(mas_time[i]) { pix = "<div style=\"position:absolute;top:"+y+"px;left:"+x+"px;font-size:9px;font-family: Verdana, Arial, Helvetica, sans-serif;\">"+mas_time[i]+"</div>"; document.write(pix); } x = Math.floor(zeroX+weightX*i); y = Math.floor(zeroY); pix = "<div style=\"position:absolute;top:"+y+"px;left:"+x+"px;font-size:15pt;\">|</div>"; document.write(pix); } //————————--write time prefix———- x = Math.floor(scaleX/2)-15; y = Math.floor(zeroY+40); pix = "<div style=\"position:absolute;top:"+y+"px;left:"+x+"px;font-size:9px; font-weight: bold; color:#000000;font-family: Verdana, Arial, Helvetica, sans-serif;cursor:hand;\">"+"</div>"; document.write(pix); //————————--draw diagram——————————————— for(var i=0;i<countX;i++) { if(mas_time[i]) { x = Math.floor(zeroX+weightX*i); y = Math.floor(zeroY-weightY*mas_temper[i]); pix = "<div title=\""+mas_time[i]+" / "+mas_temper[i]+"'C\" style=\"position:absolute;top:"+y+"px;left:"+x+"px;font-size:15pt;color:#FF0000;cursor:hand;\">•</div>"; document.write(pix); } } //—————————————————-- document.bgColor ="#DDDDDD"; document.title ="Temperature history for"; } </script> <style type="text/css"> v\:* {behavior:url(#default#VML);} </style> <style type="text/css"> DIV {font-family: Verdana, Arial, Helvetica, sans-serif;} </style>
<body onload="draw()">
</body> </html>
</body></html>
Ни как не могу подсунуть <v:polyline что бы он у меня по координатам рисовал диаграмму
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Здравствуйте, подскажите какой тег использовать для увеличения значения, пример на картинке.
Вроде, про такой тег я слышала. Если есть тег прогресс бар, значит и такое должно быть.
Question
Boocha
Здрасте.
Есть код,
Ни как не могу подсунуть <v:polyline что бы он у меня по координатам рисовал диаграмму
Есть у кого идеи?
Edited by s0rr0wLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.