✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Dash Daq Gauage Styling

I am trying to develop digital cluster for an electric bike using dash. I increased the radius of gauage circle but now the tracking and the needle positions are uneven.How to fix this?
Also how to show the track progress in gradient color rather than a single color?

here is my code



    scale={'start': 0, 'interval': 10, 'labelInterval': 2},









circle.track {

stroke-width: 15px;


stroke-dasharray: 1108;

stroke: rgb(94, 92, 92)!important;

background-image: radial-gradient(red, green, blue);



stroke-width: 17px;


/* stroke: linear-gradient(

  to right, 


  #fffdc2 15%,

  #d7f0a2 15%,

  #d7f0a2 85%,

  #fffdc2 85%

)!important; */

stroke: #6EE5FF   !important;



Hi @abhishekcg and welcome to the Dash Forum!

I’m certainly no css expert… but as I played with this example, here is what I found:

When you set size=350 in the daq.Gauge, and also set the radius r:184 in the css, it causes strange behavior with the track.

I don’t know what this means exactly: stroke-dasharray: 1108; but if you take it out, the pointer aligns with the numbers

You can set the gradient by adding this to the dac.Gauge:


Note that because it’s a dictionary, you need to use slightly different color numbers if you want colors repeated. (I used the color numbers and transition points from your css above. )

I don’t know how to make the gradient track wider… that’s way beyond my css skills. One workaround is to use a color from the midpoint of the gradient as the background color of the wider track. Experimenting with different colors might make something that looks OK.

With this css:

circle.track {   
    stroke-width: 20px;   
    stroke: #d7f0a2 !important;   

    stroke-width: 20px;
    stroke: #d7f0a2  !important;

the gauge will look like this:

Also, if you want to customize the numbers in the scale, see this post: How to change: space between radio-button and label / font-size of gauges?

If you find a better way to do a wider track for the gradient, I love to know about it!

@AnnMarieW hey I know that if I remove the style it will become correct but I want it with style and as for the gradient color I don’t want gradient color on the circle I want it only on the track progress(progressing circle i.e the one varying as we give value)

I see… that will look nice. I don’t think that’s possible with the built-in parameters of daq.Gauge, but if you get it working with css, I hope you will post the solution back to the forum. I’d like to use something like that as well.