javascript - Raphael JS - creating a custom progress bar -


i trying create custom progress bar in image below:

custom progress bar

i think best options creating type of component using javascript , svg or canvas, , i'm trying create in raphael js.

i wondering if possible or if it's incredible hard thing or maybe raphael not best tool doing this, pretty new raphael , managed recreate shapes using raphael js.

window.onload = function() { var paper = raphael("holder", 500, 500); var border = paper.path("m177.726,35.14c-6.51-19.56-24.73-30.02-46.369-35.14l-4.061,3.7c16.59,5.44,29.609,15.21,33.25,30.37c6.891,28.729-26.721,55.2-70.56,55.2c-43.84,0-77.45-26.471-70.55-55.2c3.64-15.16,16.65-24.93,33.24-30.37l48.616,0c-21.64,5.12-39.86,15.58-46.37,35.14c-12.83,38.52,31.03,74,87.74,74c146.696,109.14,190.556,73.66,177.726,35.14z m89.986,107.014c-33.546,0-64.678-13.115-79.311-33.411c2.173,61.81-0.044,48.742,4.263,35.812c9.725,19.401,24.444,8.14,48.018,2.332l0.595,0.542c31.43,9.313,20.658,19.875,17.369,33.574c-2.601,10.831,0.055,21.67,7.682,31.346c12.873,16.331,37.755,26.477,64.935,26.477c27.177,0,52.06-10.145,64.936-26.475c7.63-9.676,10.29-20.516,7.691-31.348c-3.289-13.696-14.065-24.26-31.253-30.701l0.594-0.542c23.574,5.809,38.293,17.069,43.754,33.48c4.307,12.93,2.09,25.998-6.412,37.791c154.663,93.898,123.532,107.014,89.986,107.014z"); var fill = paper.path("m173.587,33.481c168.126,17.069,153.407,5.809,129.833,0l-0.594,0.541c17.188,6.441,27.963,17.004,31.252,30.701c2.6,10.832-0.061,21.672-7.691,31.348c-12.875,16.33-37.758,26.475-64.936,26.475c-27.18,0-52.063-10.146-64.936-26.477c-7.627-9.676-10.283-20.516-7.682-31.346c18.536,17.543,29.309,6.981,46.491,0.542l45.896,0c22.322,5.809,7.603,17.069,2.142,33.48c-4.307,12.931-2.09,25.998,6.412,37.791c14.633,20.296,45.764,33.411,79.311,33.411s64.678-13.115,79.311-33.411c175.677,59.478,177.894,46.411,173.587,33.481z");  border.attr({     fill: "#00ffff", });  fill.attr({     fill: "#99ff00", }); } 

js fiddle shapes

it better go canvas using kineticjs or other api in order quick started geometrical shapes , manipulation. since can use color transitions in order progress want see. approach if canvas rather svg.


Comments