954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

command to draw circle in javascript

Is there a command to draw a circle in javascript or I have to use only a circle picture?
Also is there a way to arrange many circles randomly in a browser page ,using html/javascript?

kararu
Junior Poster in Training
50 posts since Sep 2006
Reputation Points: 20
Solved Threads: 0
 

You will need to use SVG to do this which is not widely supported yet. So basically you will need to use images.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

Hi,

Use a transparent background circle image in gif or png format and create many image instance with javascript assigned to the smae source. You can even arrange their radius with using a single image given it has the resolution of the largest circle to avoid aliasing and pixelation effects.

Loren Soth

Lord Soth
Posting Whiz in Training
233 posts since Mar 2006
Reputation Points: 28
Solved Threads: 4
 

you can use Open-jACOB Draw2D

seen on [url snipped - this is now a commercial venture]

greetings

FreeGroup

FreeGroup
Newbie Poster
4 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

Why not use Javascript's rounded corners capabilities?

Create a square with css then round the corners to the point that it eventually becomes a circle. This way is all made with code and it's more widely supported than trying to use a png.

Leaping Fish
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 
Is there a command to draw a circle in javascript or I have to use only a circle picture?

There are a number of good - and free - javascript plot/graph packages.Also is there a way to arrange many circles randomly in a browser page ,using html/javascript?

Once you have the circles (whether plots or images), yes. They can even be animated. http://www.dynamicdrive.com/dynamicindex3/bubble.htm

fxm
Posting Pro
596 posts since Apr 2010
Reputation Points: 40
Solved Threads: 74
 

Also get into this plug in processing.js

http://processingjs.org/

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You