Function Repository Resource:

RadarChart

Source Notebook

Show numerical data in a radar-style chart

Contributed by: Andrew Steinacher

ResourceFunction["RadarChart"][<|lbl1val1,lbl2val2,|>,]

plots each of the vali in a radar chart with labels lbli.

Details and Options

Other names for a radar chart include web chart, spider chart, star chart, star plot, cobweb chart, irregular polygon chart, polar chart or Kiviat diagram ».

Examples

Basic Examples (1) 

Show values in a radar chart:

In[1]:=
ResourceFunction[
 "RadarChart"][<|"A" -> 1, "B" -> 2, "C" -> 3, "D" -> 4|>]
Out[1]=

Options (3) 

ChartStyle (1) 

Use a different color:

In[2]:=
ResourceFunction[
 "RadarChart"][<|"A" -> 50, "B" -> 100, "C" -> 200, "D" -> 75|>, ChartStyle -> Directive[Thick, Blue]]
Out[2]=

PlotRange (2) 

By default, the largest value is used to determine the maximum plot range:

In[3]:=
ResourceFunction[
 "RadarChart"][<|"A" -> 50, "B" -> 100, "C" -> 200, "D" -> 75|>]
Out[3]=

Use PlotRange to explicitly set a value:

In[4]:=
ResourceFunction[
 "RadarChart"][<|"A" -> 50, "B" -> 100, "C" -> 200, "D" -> 75|>, PlotRange -> 500]
Out[4]=

Applications (2) 

Gather and compare the nutrition content of two foods:

In[5]:=
foodToNutrition = EntityValue[{Entity["Food", "McdonaldsBigMacWithoutBigMacSauce::zxvg9"], Entity["Food", "SweetPotatoCannedMashed::7w373"]}, {"RelativeTotalProteinContent", "RelativeTotalCarbohydratesContent", "RelativeTotalFatContent", "RelativeTotalFiberContent"}, "EntityPropertyAssociation"]
Out[5]=

Visualize the foods in radar plots:

In[6]:=
ResourceFunction["RadarChart"][
   QuantityMagnitude[#] // KeyMap[StringDelete["Relative" | "Content" | "Total"]], ImageSize -> 300, PlotRange -> 0.2] & /@ foodToNutrition
Out[6]=

Publisher

Andrew Steinacher

Version History

  • 1.0.0 – 14 August 2019

Author Notes

This implementation is based on the non-trivial nutrition implementation of a radar plot shown in the documentation for SectorChart (Examples Applications "Create a radar graph of nutritional content...").

License Information