Jump to content
We've recently updated our Privacy Statement, available here. ×

Multilevel pie charts

Nessa Carson

Recommended Posts

I'd love to make multilevel pie charts. Note: these are not with nested data; just data that share the same categories. My data will describe the % components of a system, at two or more different timepoints.

I'd like it to look like this, that I found on the web:


I basically just need to have two pie charts, on top of each other. I want to show multiple multilevel pie charts in a lattice, so eg: I could have a lattice with 2 x 2 multilevel pie charts, each of the four lattice cells containing 2+ concentric pie charts.

The "doughnut chart" (whitespace in the middle) aspect is irrelevant to me. I would love it if Spotfire had the capability to show multiple charts on top of each other in a lattice.

Link to comment
Share on other sites

Hi Nessa,

There are a number of JavaScript visuals available that allow you to do this.

You can use these inSpotfire by leveraging theJSViz framework.


After you have the JSViz framework installed you could have a look at this JS visual for exampleto create the multilevel pie chart.


Best of luck!

Alain Martens

Link to comment
Share on other sites

Nice workaround! I am relatively new to this. I guess the exact answer isn't the same as the data are nested, whereas mine are unrelated values but the same categories; it's basically two different pie charts. But I have not played with it yet, so perhaps that is also possible!


Was going to post a workaround I did yesterday - use a map chart withmarkers as pies, then set up 2+layers of differently-sized markers, placed at the same, arbitrary, coordinate locations. That way, the outer circle is completely independent of the inner circle. Ensure all pies per layer are of identical size, otherwise you get a data overload headache.




I guess it's quite inelegant as you're loading the same categories and labels twice, plus a hidden world map per trellis square,but it looks how I needed it to and is easy to customize. Other downside is that getting the right zoom level for perfect aesthetics (apparently my pies are "2 km" in diameter)is initially more challenging than you may expect!

Link to comment
Share on other sites

Hi Nessa,


You can use multiple data tables using JSViz is not an issue so that still is a good option to implement your nested data use case. 


The workaround you're suggesting is very valid too. Map charts visuals are being used without a map quite often. People often add an image layer in them to use as a floor plan (for a factory for example) but even without an image as you're suggesting is fine. The layer is not being loaded so you're not paying a performance penalty. 


I'm very curious about your workaround. Please post it here if you can.





Link to comment
Share on other sites

  • 5 weeks later...

Hi Alain, 


This is how it works for me: create map chart, add 2 x data tables as marker layers as pies. For each, set postitioning -> coordinate columns with custom expressions (x, y) = (1, 1). I then set this up as a trellis, as I need to be able to view a large number of multilevel pies at once. Each trellis square ends up viewing a different pair of pies, but always at point (1,1) in the same zoom. 


Lastly, ensure the pies are of fixed size - otherwise it gets confusing - and the bottom one is bigger than the inner one. 


Looks a lot like this! 


[[{"fid":"173736","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"lattice of multilevel pie charts","field_file_image_title_text[und][0][value]":false,"height":"","width":""},"type":"media","field_deltas":{"1":{"format":"default","field_file_image_alt_text[und][0][value]":"lattice of multilevel pie charts","field_file_image_title_text[und][0][value]":false,"height":"","width":""}},"attributes":{"alt":"lattice of multilevel pie charts","class":"file-default media-element","data-delta":"1"}}]]


Another term for 'multilevel pie charts' is cake charts: that's definitely my preferred term, as cake is good! 






Note: my data are not nested! 

Link to comment
Share on other sites

  • 2 weeks later...

I've noticed a sort of bug with my answer here. You don't seem to be able to create a (useful) pie chart with more than 2 levels. All the ones I'd done until now have had two levels.

However, you can only have one "interactive" layer and one "trellised" layer. And unless your layer is interactive or trellised, it shows exactly the same data across all trellis positions. So, there's a maximum of two layers that can vary data across the trellis. Here's an image where the outer and middle layers are displaying trellised data, but the middle layer shows up as all red for every pie.


Surely this is a bug in the software It makes no sense that a layer would be trellised by another layer's variables if it's marked as interactive, but not trellised at all if it isn't.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...