kottenator/jquery-circle-progress

Labels and gradient customization

Closed this issue · 11 comments

Hi, just have a couple of quick questions. I've been struggling to implement the following customizations.

  • How do you change the gradient such that the second color is the end color of the circle? (ie. there would be a hard transition between the end and start color instead of fading back into the start color)
  • How do I add a label/image to the end value of the progress bar?

I've added the image below for illustration.

screen shot 2015-09-17 at 3 44 34 pm

Any help would be much appreciated!

Hi! I will crete a snippet for you on this weekend (sorry, can't do this right now)

Wow, thanks for the quick reply and thanks for your help, much appreciated! Great plugin btw!

Here is my snippet.

Answering to your questions:

  • you're looking for conical asymmetric gradient which is not available for <canvas> yet. But there is a way to make it - using image fill (that's what I do in my snippet)
  • adding a label to the arc end point is a bit tricky - you have to calculate coordinates by yourself (see my snippet code)

That's perfect! Thanks again so much for your help and your time.

Here is an updated version of the snippet that also animates the value.

Hi, how can I create this background square like in your examples?

@PowerfulPaw : I didn't quite get you - what square?

Oh, I see. That's a conical gradient - you can create it in many graphical editors (Photoshop, GIMP, etc). Sorry, I haven't found a good tutorial but I'm sure you'll handle it ;)

Thanks for answer, I thought I could make it with CSS.

Unfortunately, it's only in CSS4 draft yet :(