You can also try using the HTML5 canvas feature. Here you can learn more about CANVAS.
Please visit FiddleDemo .
HTML
<canvas width="400" height="400" id="circles"></canvas>
Javascript
var circle = $('#circles').get(0).getContext('2d'); var circles = [ { x: 50, y: 50, r: 25, c: "#78BA00" }, { x: 80, y: 100, r: 35, c: "#F4B300" }, { x: 150, y: 170, r: 15, c: "#78BA00" }, { x: 50, y: 220, r: 20, c: "#F4B300" }, { x: 60, y: 150, r: 10, c: "#78BA00" }, { x: 70, y: 170, r: 15, c: "#F4B300" }, { x: 110, y: 220, r: 16, c: "#78BA00" }, { x: 130, y: 150, r: 2, c: "#F4B300" }, { x: 60, y: 150, r: 5, c: "#78BA00" }, { x: 70, y: 170, r: 12, c: "#F4B300" }, { x: 110, y: 30, r: 21, c: "#78BA00" }, { x: 180, y: 60, r: 2, c: "#F4B300" }, { x: 70, y: 90, r: 21, c: "#78BA00" }, { x: 220, y: 110, r: 2, c: "#F4B300" } ]; function drawCircle(data) { circle.beginPath(); circle.arc(data.x, data.y, data.r, 0, Math.PI * 2); circle.fillStyle = data.c; circle.fill(); } $.each(circles, function() { drawCircle(this); });
Explanation {x: 50, y: 50, r: 25, c: "# 78BA00"},
- x: x-axis position in pixels
- y: y-axis position in pixels
- r: radius in pixels
- c: specify color in hexadecimal format
Using the above options, you can place the size and color of the circles according to your needs.
Most importantly, this solution is independent of server-side scripting.