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.

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 :)

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.

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