Logo
UI Elements

Radar Chart

Compare several attributes around a radial scale

Overview

Radar Chart places each attribute on its own axis and connects the values into a polygon. It is useful for profiles, ratings, and other sets of related measurements.

Preview

Usage

Create a Radar Chart and add at least three labeled attributes.

Set a common Maximum Value for the axes.

Choose which fill, line, point, grid, and label layers to display.


Public API

Use RadarChart in the Evo.UI namespace.

Properties

Setting a property refreshes the chart. After editing dataPoints or a shape settings field directly, call DrawChart().

NameTypeDescription
MaximumValuefloatValue represented by the outermost grid polygon.
StartAnglefloatAngle of the first axis in degrees counterclockwise from the right. Wraps at 360.
ShowLineboolShows the line connecting the data points.
LineThicknessfloatData line width in local UI units, from 0.1 to 20.
ShowFillboolShows the filled area.
ShowPointsboolShows a marker at each data point.
PointSizefloatDiameter of each data marker in local UI units, from 0.1 to 50.
ShowGridboolShows grid lines.
GridLevelsintNumber of concentric grid polygons, from 1 to 30.
GridLineThicknessfloatGrid line width in local UI units, from 0 to 20.
ShowAxisboolDisplays the chart axes.
AxisThicknessfloatAxis line width in local UI units, from 0 to 40.
ShowLabelsboolShows labels.
LabelFontSizefloatCategory label font size.
LabelOffsetfloatDistance beyond the plot radius for category labels in local UI units.
ShowValuesboolDisplays each value under its label. Requires Show Labels.
DrawLabelBackgroundboolDraws a procedural background behind each label.
LabelPaddingVector2Horizontal and vertical inset on each side of a label background, in local UI units.
LabelCornerRadiusfloatUniform label background corner radius.
DisplayFormatNumberDisplayFormatNumeric format used by value and scale labels.

Fields

NameTypeDescription
dataPointsList<DataPoint>Attribute labels and values.
labelShapeShapeSettingsLabel background corner, softness and outline settings.

Methods

NameParametersDescription
AddDataPoint()string label, float valueAdds a labeled value.
AddDataPoint()DataPoint pointAdds a DataPoint object.
SetDataPoint()int index, float valueChanges a value by index.
SetDataPoint()string label, float valueChanges a value by label.
SetDataPoint()DataPoint data, string label, float valueChanges the label and value of a data point.
UpdateAllData()float[] valuesReplaces values in the current attribute order.
RemoveDataPoint()string labelRemoves a data point by label.
RemoveDataPoint()int indexRemoves a data point by index.
RemoveDataPoint()DataPoint pointRemoves a data point by reference.
ClearDataPoints()NoneRemoves all attributes.
DrawChart()NoneRefreshes the chart.

Example

RadarChartExample.cs
using UnityEngine;
using Evo.UI;

public class RadarChartExample : MonoBehaviour
{
    [SerializeField] private RadarChart target;

    private void Start()
    {
        target.ClearDataPoints();
        target.MaximumValue = 100f;
        target.AddDataPoint("Speed", 80f);
        target.AddDataPoint("Power", 65f);
        target.AddDataPoint("Control", 90f);

        // Call this when modifying the data entries directly
        target.DrawChart();
    }
}

On this page