I am a big fan of Stephen Few. I have probably sold more books for the guy than Amazon. I am also a big fan of the Tableau. So it pains me to see them fighting. It's like watching two friends fight. At first it's kind of cool. Now I am just balled up in the corner crying, begging them to stop. Well that might be exaggerating. But it's sad.

Most recently Few got in an internet feud with George Peck after Peck argued that gauges in Tableau would not be the end of the world. Which is probably true. Peck cited a client who wanted gauges to replace an existing dashboard and was turned off of Tableau because it wasn't possible. Now as a person who is often forced to use SAP for my job I hate the gauge. It is a stupid waste of space. But I also thought it is definitely possible to make a gauge chart in Tableau. So I did. Behold the stupidity...

It was actually pretty simple. Download the workbook to see but I created the X and Y variables to plot points on a half-circle using excel. The angles range from 0 to 180 at increments of 5 degrees. I then created a parameter which is the slider with a condition that moves the point around the circumference with a fixed origin point at 1,1. The chart is ultimately a line chart with a path connecting the origin point and the conditional circumference point. There is also a custom background image that is the gauge itself. Finally, I included a totally awesome bullet chart for comparison.
- Adam P.S. It felt wrong to create this. UPDATE: Here is a link to the data file I used to create this.

This is a very amusing post, Adam. Love it. As I've never worked with background images in Tableau, can you help me understand how you chose/generated the X, Y and ID values in the underlying data for this chart?

Where Z = the angle. For this chart there are 36 angles between 0 and 180 at intervals of 5 degrees. 0 and 180 are necessary to form the half circle. I chose 5 arbitrarily but you can set those intervals at whatever you want with the formula above. The ID values just represent the row. Also you will need a point at 1,1 which is the origin point of the stick which moves around the half circle.

Finally the background image is just a custom image I created. Let me know if that makes sense.

Thanks Adam. It does make sense, theoretically. I've just never used those kinds of formulas, so would need to play around with them in order to fully grok them.

Hi Adam, I need to do a gauge chart, to show actual and budget values. how can i show this gauge with this two values. do i need to add any additional fields like Angle , X and Y axes values. Please suggest me to do this.

Honestly a gauge probably isn't your best bet. I would do a bullet chart because that is exactly what they are meant for. But if you must, follow the instructions above (and/or download my workbook) to create the actual value. Then create a custom background image for the budget values.

Thanks for your reply,i have downloaded your workbook, i have observed that the needle is moving based on the angle column values(Increments with 5 between 0 to 180). In my scenario , i am calculating this for Actual vs. budget. how do i calculate this angle in my case as the actual and budget values are in lakhs. is it possible to display two needles(one for actual & one for budget), please help me in this issue.

Nagaraju - I actually have the same question; however, I think that the 1,1 point could be the budget number and everything left of center would be under budget (by percentage?) and everything right would be over budget. Have you found a solution to this?

I'd also like to see the excel file to this. I'm running into the same issue as Mohit. Could you also explain more how you have your Parameter Filter set up? Perhaps some screen shots?

Here is a link to the data: https://drive.google.com/file/d/0B7xv5XOVMuVzaXZjek9pVFVOYkU/edit?usp=sharing

There are only 38 rows. 1 row is the fixed origin point where the X and Y is 1 and 1. This is the starting point of your gauge meter at the bottom, center of your image. The other 37 are points along the radar circumference. I have 37 because 180 degrees divided by increments of 5 = 36 + 1 at the starting point at 0. You can select whatever increments you like.

The formulas for the X and Y points are in there as well. In Tableau I place the Y measure on the columns shelf and the X measure on the rows shelf.

The parameter filter does two things: fix the origin point which is row 1 in my data set (IF([X]=1 AND [Y]=1,1)) so it doesn't move AND display the circumference point based on the parameter. So as the you alter the parameter a different point on the circumference is displayed. So the filter makes sure only 2 points are displayed. The angle in the path shelf then connects these 2 points.

SO Adam, can you humor an old guy here....If I were to download your 1-38 data file and align my measurements withe 38 lines that form the circle, could I mirror image the gauge? I have many measurements that I could conceivable divide into 38 segments to line up withe X and Y axis lines. An example might be the attendance rate for students in a school. IE: 97 to 100% is 38 and 50% is 19 on your chart.

Fixed the link. Here is the new one: https://drive.google.com/open?id=0B7xv5XOVMuVzSDRmNUl3MHo4N2M. Also I have a new cleaner approach that I will post soon.

It would just be nice if Tableau would make this sort of gauge available. It is a view some administrators like to see. It is a simple non detailed view.

If i have to use a different background image with smaller pointer length ..how do i achieve that .. ?? Length here seems to be tied with the angle ( 5,10,15 etc ..) ? The X & Y co-ordinates are the calculated value from formula with angles .. ?

I noticed your gauge chart which is really nice. I'm actually trying to use your gauge chart to be dynamic with my calculated results:

I am calculation a percentage based on numbers and I would like to link this percentage to your parameter. In the example you used 37 as max value (I adjusted it to 100, which reconcile to the percentage).

Do you know if there is a quick way to link my result to your gauge chart?

I to adjust your calculated field: "Parameter filter". That the parameter is not the source to check with but my own calculated field. This resulted in the following error: Cannot mix aggregate and non aggregate arguments with this function.

I hope you have a solution for this, so I can use my result to present in your chart :)

You can download the Tableau workbook by clicking Download button on the bottom right of the viz itself. http://public.tableau.com/shared/3GGF4CKTN?:display_count=yes

You can download the Tableau workbook by clicking Download button on the bottom right of the viz itself. http://public.tableau.com/shared/3GGF4CKTN?:display_count=yes

I am trying to replicate the same and could not do that. Could you please elaborate in step procedure how to create in tableau since I need to build a guage for my data

Hey Adam or anyone else who may be able to answer this,

I have looked at both this blog and https://duelingdata.blogspot.com/2017/09/how-to-gauge-chart-in-tableau-updated.html?showComment=1522175909579#c7670037545081334917. I have made my own chart, but it has a problem. Whenever I hover over the starting point, it displays all of the data point's names instead of a nice X:1, Y:1. How can I either get the names to disappear or set 1,1 as the starting point for the x,y coordinate? Any help s greatly appreciated!

So, I have been puzzling with this question. The client wasn't see the 12 months on the Gauge which is doable using this approach. But we also have a total Sales Amount that I need to show for each month or between months based on Current Date. Not sure how to show Needle Pointing to Sales and the Month. I think there might be tow visuals involved. Like the Needle point to the Sales on the Gauge from 0 to max and show the Current Month on a different way since they whole Gauge is Copy/Paste to a presentation.. No user parameters.. Any ideas will greatly appreciate it..

This is a very amusing post, Adam. Love it. As I've never worked with background images in Tableau, can you help me understand how you chose/generated the X, Y and ID values in the underlying data for this chart?

ReplyDelete-Mike

Hey Mike. Thanks. The X and Y coordinates represent the points on a half circle. I calculated the X and Y with the following formulas:

ReplyDeleteX = 1 + SQRT(2) * SIN(Z * PI() / 180)

Y = 1 + SQRT(2) * COS(Z * PI() / 180)

Where Z = the angle. For this chart there are 36 angles between 0 and 180 at intervals of 5 degrees. 0 and 180 are necessary to form the half circle. I chose 5 arbitrarily but you can set those intervals at whatever you want with the formula above. The ID values just represent the row. Also you will need a point at 1,1 which is the origin point of the stick which moves around the half circle.

Finally the background image is just a custom image I created. Let me know if that makes sense.

Thanks Adam. It does make sense, theoretically. I've just never used those kinds of formulas, so would need to play around with them in order to fully grok them.

ReplyDeleteCareful, by Few's standards you've just given children instructions for printing guns on their 3D printers

ReplyDeleteHi Adam,

ReplyDeleteI need to do a gauge chart, to show actual and budget values. how can i show this gauge with this two values. do i need to add any additional fields like Angle , X and Y axes values. Please suggest me to do this.

Honestly a gauge probably isn't your best bet. I would do a bullet chart because that is exactly what they are meant for. But if you must, follow the instructions above (and/or download my workbook) to create the actual value. Then create a custom background image for the budget values.

DeleteHi Adam,

ReplyDeleteThanks for your reply,i have downloaded your workbook, i have observed that the needle is moving based on the angle column values(Increments with 5 between 0 to 180). In my scenario , i am calculating this for Actual vs. budget. how do i calculate this angle in my case as the actual and budget values are in lakhs. is it possible to display two needles(one for actual & one for budget), please help me in this issue.

Thanks in advance,

Nagaraju

Nagaraju - I actually have the same question; however, I think that the 1,1 point could be the budget number and everything left of center would be under budget (by percentage?) and everything right would be over budget. Have you found a solution to this?

Deletetry normalizing it.

DeleteThis comment has been removed by a blog administrator.

ReplyDeleteHi Adam,

DeleteCould you share the .xls file (data) for this?

Somehow I am not able to see more than 38 rows in "view data" option.

Thanks! :)

I'd also like to see the excel file to this. I'm running into the same issue as Mohit. Could you also explain more how you have your Parameter Filter set up? Perhaps some screen shots?

DeleteHere is a link to the data: https://drive.google.com/file/d/0B7xv5XOVMuVzaXZjek9pVFVOYkU/edit?usp=sharing

DeleteThere are only 38 rows. 1 row is the fixed origin point where the X and Y is 1 and 1. This is the starting point of your gauge meter at the bottom, center of your image. The other 37 are points along the radar circumference. I have 37 because 180 degrees divided by increments of 5 = 36 + 1 at the starting point at 0. You can select whatever increments you like.

The formulas for the X and Y points are in there as well. In Tableau I place the Y measure on the columns shelf and the X measure on the rows shelf.

The parameter filter does two things: fix the origin point which is row 1 in my data set (IF([X]=1 AND [Y]=1,1)) so it doesn't move AND display the circumference point based on the parameter. So as the you alter the parameter a different point on the circumference is displayed. So the filter makes sure only 2 points are displayed. The angle in the path shelf then connects these 2 points.

Let me know if that makes sense.

- Adam

SO Adam, can you humor an old guy here....If I were to download your 1-38 data file and align my measurements withe 38 lines that form the circle, could I mirror image the gauge? I have many measurements that I could conceivable divide into 38 segments to line up withe X and Y axis lines. An example might be the attendance rate for students in a school. IE: 97 to 100% is 38 and 50% is 19 on your chart.

DeleteAdam, the link for data doesnot have the file. Can you please upload it again and provide the link? Thanks

DeleteFixed the link. Here is the new one: https://drive.google.com/open?id=0B7xv5XOVMuVzSDRmNUl3MHo4N2M. Also I have a new cleaner approach that I will post soon.

DeleteThanks Adam!! Will wait for your post on new approach

DeleteThis comment has been removed by the author.

ReplyDeleteIt would just be nice if Tableau would make this sort of gauge available. It is a view some administrators like to see. It is a simple non detailed view.

ReplyDeleteAnyone with direct application for this gauge in a data set, please contact me to try using it as a template.

ReplyDeleteIf i have to use a different background image with smaller pointer length ..how do i achieve that .. ?? Length here seems to be tied with the angle ( 5,10,15 etc ..) ? The X & Y co-ordinates are the calculated value from formula with angles .. ?

ReplyDeleteHello,

ReplyDeleteI noticed your gauge chart which is really nice. I'm actually trying to use your gauge chart to be dynamic with my calculated results:

I am calculation a percentage based on numbers and I would like to link this percentage to your parameter. In the example you used 37 as max value (I adjusted it to 100, which reconcile to the percentage).

Do you know if there is a quick way to link my result to your gauge chart?

I to adjust your calculated field: "Parameter filter". That the parameter is not the source to check with but my own calculated field. This resulted in the following error:

Cannot mix aggregate and non aggregate arguments with this function.

I hope you have a solution for this, so I can use my result to present in your chart :)

Regards

Hi may I ask where to download this workbook?

ReplyDeleteYou can download the Tableau workbook by clicking Download button on the bottom right of the viz itself. http://public.tableau.com/shared/3GGF4CKTN?:display_count=yes

DeleteHi Adam,

ReplyDeleteMay I ask where can I download this? is it in Tableau public?

You can download the Tableau workbook by clicking Download button on the bottom right of the viz itself. http://public.tableau.com/shared/3GGF4CKTN?:display_count=yes

DeleteHi Adam,

ReplyDeleteI am trying to replicate the same and could not do that. Could you please elaborate in step procedure how to create in tableau since I need to build a guage for my data

This comment has been removed by the author.

ReplyDeleteHey Adam or anyone else who may be able to answer this,

ReplyDeleteI have looked at both this blog and https://duelingdata.blogspot.com/2017/09/how-to-gauge-chart-in-tableau-updated.html?showComment=1522175909579#c7670037545081334917. I have made my own chart, but it has a problem. Whenever I hover over the starting point, it displays all of the data point's names instead of a nice X:1, Y:1. How can I either get the names to disappear or set 1,1 as the starting point for the x,y coordinate? Any help s greatly appreciated!

I cannot find the option where or how to format the bar. make it a little thicker.. can someone help?

ReplyDeleteHi

ReplyDeleteThank u for your example

It's very helpful

I have a question, i am trying to implement this on pages and without using parameter, can u help me with the line draw ? i can't figure it

Hi Adam,

ReplyDeleteMay I know how you create the background image of the gauge meter?

So, I have been puzzling with this question. The client wasn't see the 12 months on the Gauge which is doable using this approach. But we also have a total Sales Amount that I need to show for each month or between months based on Current Date. Not sure how to show Needle Pointing to Sales and the Month. I think there might be tow visuals involved. Like the Needle point to the Sales on the Gauge from 0 to max and show the Current Month on a different way since they whole Gauge is Copy/Paste to a presentation.. No user parameters.. Any ideas will greatly appreciate it..

ReplyDelete