In the past, I've made a circular spreadsheet in Javascript, which can be seen in here : http://secteur-3.net/ARN-Public/ARN.html (left matrix). Each cell is bound to some data and have minimum interaction (hover as an example).

Data are numbers (1 to 1000 let's say), so it's stored in 1000 cells, but rather than having a 10x100 row/col table, it's a circular table. In this circular table/spreadsheet, each cell gets a different color attribute depending if its stored value is a prime number or not and depending on the number of divisors the value can have.

I'm wondering if I could acheive the same result with Mathematica and if so, I would like to be pointed in the right direction. I've looked at different graph options, but can't seem to find the right approach. SectorChart may visually do the trick, but "data" are only visual attributes (x,y,z) of a sector, whereas my data are numerical values that should not affect (x,y,z) - only color.

Maybe I could use labels as a placeholder for my data? Or some other programatically accessible properties of a sector?

Note: It can be a static chart/table, I do not need it to be as interactive as it is in the provided link.

Any help would be appreciated!

  • $\begingroup$ How about SectorChart3D? This allows for a third dimension, which could presumably be tied into the spreadsheet data. $\endgroup$
    – bill s
    Commented Dec 11, 2018 at 18:48
  • $\begingroup$ Well, adding a dimension wouldn't help. I'm really looking to have a circular table with rows and columns with data in it - or at least assigned to each "cell" for data manipulation. On the provided link, if you click on the eye icon and then any checkbox/slider you'll see what I mean by 'manipulaiton'. $\endgroup$
    – Steph
    Commented Dec 11, 2018 at 19:12
  • 1
    $\begingroup$ Isn't that exactly what a third dimension is? There's an x-y position (around the sector) and a value associated with that position. That value would be your data, or maybe a pointer to your data. PieChart3D works similarly. $\endgroup$
    – bill s
    Commented Dec 11, 2018 at 19:40
  • 1
    $\begingroup$ OK, I must be too new then to Mathematica because for me SectorChart3D[{{x1,y1,z1},{x2,y2,z2},…}] are simply visual parameters and not data per se as in a spreadsheet i.e. accessible by row/col to retreive stored data. I must be missing something. $\endgroup$
    – Steph
    Commented Dec 11, 2018 at 23:50
  • $\begingroup$ How about Table + Tooltip(*or any other wrapper*) + Annulus ? $\endgroup$
    – Kuba
    Commented Dec 19, 2018 at 12:03

2 Answers 2


enter image description here

n = 200;
k = 10;
data = Map[Tooltip[1, #] -> {#, FactorInteger[#][[All, 1]], Most @ Divisors[#]} &, 
  Transpose @ Partition[Range[n], k], {-1}];
p2 = Partition[Range[0, 2 Pi, 2 Pi/(n/k)], 2, 1];

DynamicModule[{lg = {"", "", ""}, cef = ChartElementData["Sector"], legend = {}},
 cef = (Dynamic[{EdgeForm[{Thin, Gray}], If[CurrentValue["MouseOver"], 
   {FaceForm[Opacity[1, Red]], lg = #3[[1]]; ChartElementData["Sector"][##], 
    Opacity[1, Purple], 
    ChartElementData["Sector"][{p2[[1 + Quotient[#, k]]], 
     {Mod[#, k, 1] + 1/2, Mod[#, k, 1] + 1}}, 1] & /@ #3[[1, 2]],
    Opacity[1, Green], 
    ChartElementData["Sector"][{p2[[1 + Quotient[#, k]]], 
     {Mod[#, k, 1], Mod[#, k, 1] + 1/2}}, 1] & /@ #3[[1, 3]]}, 
  ChartElementData["Sector"][##]]}] &);
 legend = Placed[Dynamic @ SwatchLegend[{Red, Purple, Green}, 
     MapThread[Row[{##}] &, {Style[#, 20] & /@ {"n = ", "prime factors = ", "divisors = "}, 
       Style[#, 16, If[MousePosition["Graphics"] === None ||          
        Norm[MousePosition["Graphics"]] > k + 1, White, Black]] & /@ lg}]],
   {Top, Left}];
 PieChart[data, ChartElementFunction -> cef, 
  SectorOrigin -> {{0, 1}, 1}, SectorSpacing -> 0, 
  PerformanceGoal -> "Speed", ChartStyle -> Opacity[0], 
  ImageSize -> 500, ChartLegends -> legend, 
  PolarGridLines -> {Range[0, 2 Pi , 2 Pi/(n/k)], {1, k + 1}}]]

Note: n is removed from the list Divisors[n] to reduce visual clutter.

  • $\begingroup$ Amazing! Many thanx for that. Looks pretty Chinese to me at the moment, but it'll help me learn faster ;) Thanx again! $\endgroup$
    – Steph
    Commented Oct 24, 2019 at 12:37

Maybe this will get you started. Since you haven't given any data to display, I'll make some up -- here is a multiplication table displayed by SectorChart3D:

data = Table[{a, b, a b}, {a, 1, 6}, {b, 1, 6}]

enter image description here

If you hover the mouse over the chart (when in Mathematica) you can see a little tooltip pop up and display the data for that sector. Of course you can change the appearance in numerous ways: color, style, etc.

  • $\begingroup$ Thank you for this example, but now I see where I'm not being understood - although I've tried to say it. You call "data" the visual attributes (x,y,z) of a sector, but my data are numerical values that should not affect (x,y,z). A spreadsheet row/col (x,y) attributes are not affected by the data that's in them. Hope I'm making it clear what I want. Maybe I could use labels as a placeholder for my data? Or some other programatically accessible properties of a sector? $\endgroup$
    – Steph
    Commented Dec 12, 2018 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.