0

Hello, I was wondering how I could dynamically generate an image via Java/Javascript.

Here is what I need:

There will be a tiny sprite-like image in the middle. What I want is to have a partial circle around the sprite appear. It will have a drop-down with 3 options, each changing the diameter of the circle. Then I want the other input box to accept numbers and that number will decide how complete the circle is, out of 360 Degrees. For instance, if someone typed in 359, then their circle would be almost complete. Does anyone know where to start with this?

Thanks, James

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by RGStrat
0

Hello again. I'm having problems with the JS Diagram builder I meantioned earlier.
Here is the JS file that it references: http://www.lutanho.net/diagram/diagram.js

Now here is the diagram code:

<DIV STYLE="position:absolute; top:0"></DIV>
<SCRIPT Language="JavaScript">
var i, x, y, xmin=parent.xmin, xmax=parent.xmax, ymin=parent.ymin, ymax=parent.ymax, rd=parent.rd;
document.open();
var D=new Diagram();
D.SetFrame(60, 45, 460, 445);
D.SetBorder(-200, 200, -200, 200);
D.SetText("Ft.","Ft.", "y=f(x)");
D.Draw("#DDDDDD", "#000000", true, "y="+rd);
document.close();
Draw();
function Draw()
{ 
P=new Array();
document.open();
P[0]=new Pie(D.ScreenX(0),D.ScreenY(0),10,200,0,rd,"#ff6060");


}
</SCRIPT>

Here's my problem: the diagram works perfectly...unless you choose something other than 360 degrees. It still generates then, but the "pie" slice jumps up. Since this is a coverage calculator, it is critical that it is to scale at all times. Does anyone know how to fix this?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.