A radar chart visualizes multivariate data in a 2D chart of three or more quantitative variables represented on axes.
The project is created using AngularJS and D3.js.
-
This is a variation of the original and improved D3 radar chart.
-
Major improvements include:
- Refactoring D3 components (
levels
,labels
,axes
,polygons
,legend
), which now can be controlled through theconfig
object. - Abstracting the building and rendering portions of the D3 visualization.
- Aside from the basic stacked view, this variation includes a facetting option to plot the graphs in a facet grid.
- Refactoring D3 components (
-
Use the configuration parameters to adjust the plot to your tastes, and you can also choose to view the plots stacked vs facetted.
-
The data input has to be a 4-column CSV (headers MUST be included) conforming to the data schema of:
-
group (int/string)
: data to be grouped into an object to plot the required polygon on the radar chart. -
axis (int/string)
: the axis of the radar charts (dimensions of the multivariate data). -
value (int)
: the data value of the given record. -
description (int/string)
: not a mandatory field, and additional columns after this are accepted as well. -
All D3 logic is contained in the
radar.js
file. You should be able to look at just this file if you intend to use the visualization logic without AngularJS.
-
index.html
: Main HTML file. -
app.js
: AngularJS core logic to connect Javascript components and D3 visualization updates with user interactions. The directiveonReadFile
handles file uploads and the directiveradar
draws the D3 visualization. -
radar.js
: All D3 logic is contained in this file. You should use this file if you are looking solely to use D3 without AngularJS. -
radarDraw.js
: This is the directive-link function called by the AngularJS directiveradar
inapp.js
. Funnels the dataset from the angular app into the D3 drawing logic called fromradar.js
. -
style.css
: stylesheet containing optional D3 classes that can be adjusted (commented out) -
data.csv
: Three CSV-data files for sample downloads and uploads to the app.
- You may notice Angular digest errors in the console due to
$scope.$watch
. Not too familiar on resolving these issues. - A big help from this fiddle to help implement an AngularJS
FileReader
.