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

7 Years
Discussion Span
Last Post by RGStrat

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;
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);
function Draw()
P=new Array();
P[0]=new Pie(D.ScreenX(0),D.ScreenY(0),10,200,0,rd,"#ff6060");


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.