1 2 3 Previous Next 72 Replies Latest reply on Apr 17, 2019 1:29 PM by Mrinalini Kulkarni

    Concentric circles

    . Dan

      I have an existing Tableau map showing certain industrial facilities in Northern Japan and I want to add/overlay this map with a centre (sadly, this is the Sendai earthquake epicentre off the coast of Miyagi) and concentric rings every 20km spreading out from the centre. Is there an easy way to do this?




        • 1. Re: Concentric circles
          . Dan

          I take it this is pretty difficult...

          • 2. Re: Concentric circles
            Andy Cotgreave

            Yup. I looked at your post when you first posted, but couldn't think of anyway to do it without fabricating a complete dataset to show the circles.

            • 3. Re: Concentric circles
              Bob Laverty

              Exactly.  I created a simple test with Excel.  One column for Zip and one for circle size (1,2,3).  I put the same zip code for each of the three rows.  Then connect with Tableau.  The zip code assumes a geographic role.  The circle size was added as a measure, but I converted it to a dimension.  Place circle size into the mark size and color and I got three overlapping circles with different colors.  Play with the circle size values to approximate the appearance you need.  [I wonder if you can directly manipulate the radius through a calculated field.]  Also change the colors for transparency and effect. 


              You could add the epicenter location multiple times as a series of rows with these circle size values into the list of industrial sites.  The sites would have circle size of 1 and the concentric circles around the epicenter location would have values 2,3,4.

              • 4. Re: Concentric circles
                Joe Mako

                Tableau does not draw circles or Bezier curves, the closest you can get is a drawing a whole bunch of straight lines, that end up looking like a curve or a circle. To accomplish what you are looking for in Tableau, you would have to highly duplicate your data, and then the question becomes what is static, and what will change in the data or what will you allow your user to change when interacting with the data.


                Attached is an example that you can specify the distance of each circle with a parameter, and choose what circle to display. If you modify the underlying data, also attached, you can add more circles. Currently I just have 1 and 2, these number will be the multiples of the distance from center used.

                • 5. Re: Concentric circles
                  Joe Mako



                  I considered the approach you described, and I found that in order for that to work, the zoom level would need to be static, and there is the added time of trial and error testing. So if the underlying data changed, or there was any type of filtering interaction, the display could easily no longer be accurate.


                  I am not sure exactly how Tableau sizes marks, but I believe the have the size of a mark more closely encoded with area of the mark than height/width of the mark, with the goal to display qualitative values in a way that can be visually compared. Does anyone have detailed information on the logic Tableau uses to size marks?

                  • 6. Re: Concentric circles
                    Bob Laverty

                    I thought about the zooming problem too.  I know this approach is quick and dirty and only an approximation of the appearance.  Mapping products like ArcGIS do a better job of creating buffer areas on a map, and much richer map authoring features.  The mark size options don't appear to allow any direct manipulation of the actual size.

                    • 7. Re: Concentric circles
                      Joe Mako

                      I agree, there are many other products out there that are better for mapping things like this than Tableau. Frequently I look at these kinds of questions as brain teasers, like a fun challenge. When dealing with production data, Tableau may not be the best answer for these kinds of situations.

                      • 8. Re: Concentric circles
                        . Dan

                        Thank you Bob and Joe, it does seem that maybe this is a bridge too far for Tableau at the moment but in any case I found the ideas behind your suggestions enlightening. Much appreciated.



                        • 9. Re: Concentric circles
                          Andy Cotgreave

                          Nice work, Joe - that's definitely a good brain-teaser solution.

                          • 10. Re: Concentric circles
                            Richard Leeke

                            Yes - very good Joe.  I saw this one a day or two ago and made a note to come back and have a go - I was thinking along very similar lines using those same formulae (which I first got from Robert Mundigl's article on Clearly and Simply) - but as usual you beat me to it.


                            The only difference I was thinking of was to split the radius from the angles and use finer-grained data.


                            So I started from Joe's version and just tweaked it to do those things:


                            I put one mark per degree on the circle - that gives a pretty reasonable approximation of a smooth circle, I think.


                            I also broke the radius out to a separate table.  The latter change makes more sense if the datasource is a SQL database - that would avoid so much proliferation of redundant data.  With the data extract the cross-product query gets fully evaluated and all rows end up in the extract.  (Joe had to use an extract because JET doesn't support all the trig functions he needed - but that would work against a proper database.)

                            1 of 1 people found this helpful
                            • 11. Re: Concentric circles
                              Richard Leeke

                              I just had a bit more of a play with this to see if I could achieve the effect of circular reference bands.  The first sheet in the attached demonstrates the idea - which I think could be useful in some cases.


                              I then played around with a few more ideas - "play" becoming more and more the operative word.  Most of the other sheets use the page shelf - so click the play button to see the animation effect.  I can't really imagine much real-world use for many of those - but you never know...

                              2 of 2 people found this helpful
                              • 12. Re: Concentric circles
                                . Dan

                                Intriguing, first time for me to see custom SQL like this. Thank you for the contribution. The second example is pretty and very useable - the main issue is how to integrate it so that I can overlay my existing data!




                                • 13. Re: Concentric circles
                                  Richard Leeke

                                  Conceptually you need some custom SQL which returns all rows and columns of your existing data, with extra rows for the quake centre and each circle around it and a few extra columns for the circle properties (plus probably an indicator column telling you whether it's real data or circle data, I think).  The circle property columns would be NULL for your existing data, and the existing data columns (apart from LAT/LON) would be NULL for your circle data.


                                  So in hand wavy pseudo-SQL, you would say:


                                  SELECT 'existing' AS [type],

                                  [real_col1] AS [real_col1],

                                  [real_col2] AS [real_col2],

                                  [existing_lat] AS [lat],

                                  [existing_lon] AS [lon],

                                  ... ,

                                  NULL AS [circle_id]],

                                  NULL AS [radius]

                                  FROM [existing data]


                                  UNION ALL


                                  SELECT 'circle' AS [type],

                                  NULL AS [real_col1],

                                  NULL] AS [real_col2],

                                  [circle_centre_lat] AS [lat],

                                  [circle_centre_lon] AS [lon],

                                  ... ,

                                  [id] AS [circle_id]],

                                  [radius] AS [radius]

                                  FROM [circle data]


                                  Or something vaguely like that.

                                  3 of 3 people found this helpful
                                  • 14. Re: Concentric circles
                                    Andy Cotgreave

                                    Great work, Richard - that's a really good looking workbook. I've never yet had a need to use Polygons for any of my own Tableau work, so it still seems like a black art to me - I'm always really impressed when I see them used, whether for features like this, or choropleths, or some other out-there-Joe-Mako-solution!


                                    Your animations are incredible. As you say, a real-world application might be difficult to find, but you've done something amazing, and even if it ends up being the source for next year's April Fool gag, or some crazy Christmas card, it's great to see!


                                    1 2 3 Previous Next