You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aBounds - The rectangle defining the chart's position and size
rStyle - Optional style configuration
Data Structures
Axis Definition
structRLRadarAxis {
std::string mLabel; // Axis label textfloatmMin{0.0f}; // Minimum value for this axisfloatmMax{100.0f}; // Maximum value for this axis
};
Series Definition
structRLRadarSeries {
std::string mLabel; // Series name (for legend)
std::vector<float> mValues; // One value per axis
Color mLineColor{80, 180, 255, 255}; // Outline color
Color mFillColor{80, 180, 255, 80}; // Fill color with alphafloatmLineThickness{2.0f}; // Line widthboolmShowFill{true}; // Enable filled polygonboolmShowMarkers{true}; // Enable point markersfloatmMarkerScale{1.5f}; // Marker radius = lineThickness * markerScale
};
Normalization Mode
enumclassRLRadarNormMode {
GLOBAL, // Use global min/max across all axes
PER_AXIS // Use per-axis min/max ranges
};
Mode
Description
Use Case
GLOBAL
Single scale for all axes
When all axes measure the same metric
PER_AXIS
Independent scale per axis
When axes have different value ranges
Style Configuration
structRLRadarChartStyle {
// BackgroundboolmShowBackground{true};
Color mBackground{20, 22, 28, 255};
// Grid (spider web)boolmShowGrid{true};
intmGridRings{5}; // Number of concentric rings
Color mGridColor{50, 55, 65, 255};
floatmGridThickness{1.0f};
// Axis lines (radial spokes)boolmShowAxes{true};
Color mAxisColor{70, 75, 85, 255};
floatmAxisThickness{1.0f};
// LabelsboolmShowLabels{true};
Color mLabelColor{180, 190, 210, 255};
Font mLabelFont{};
intmLabelFontSize{12};
floatmLabelOffset{12.0f}; // Distance from chart edge to labels// LegendboolmShowLegend{true};
floatmLegendPadding{8.0f};
// Chart areafloatmPadding{60.0f}; // Padding from bounds to chart area// Normalization
RLRadarNormMode mNormMode{RLRadarNormMode::GLOBAL};
// AnimationboolmSmoothAnimate{true};
floatmAnimateSpeed{6.0f}; // Value interpolation speedfloatmFadeSpeed{4.0f}; // Fade in/out speed for series
};
// Use when axes have different value ranges
std::vector<RLRadarAxis> lAxes = {
{"Speed (mph)", 0.0f, 200.0f},
{"Weight (kg)", 0.0f, 3000.0f},
{"Price ($K)", 0.0f, 100.0f},
{"Efficiency (%)", 0.0f, 100.0f},
{"Safety (1-10)", 0.0f, 10.0f}
};
lChart.setAxes(lAxes);
RLRadarChartStyle lStyle;
lStyle.mNormMode = RLRadarNormMode::PER_AXIS;
lChart.setStyle(lStyle);
Smooth Data Transitions
// Initial data
RLRadarSeries lSeries;
lSeries.mValues = {50.0f, 50.0f, 50.0f, 50.0f, 50.0f};
lChart.addSeries(lSeries);
// Later, update with new values - animates smoothly
std::vector<float> lNewValues = {80.0f, 65.0f, 90.0f, 45.0f, 70.0f};
lChart.setSeriesData(0, lNewValues);
// In main loop
lChart.update(lDt); // Animation happens automatically
Dynamic Series Add/Remove
// Add a new series (fades in)
RLRadarSeries lNewSeries;
lNewSeries.mLabel = "New Entry";
lNewSeries.mValues = {60.0f, 70.0f, 80.0f, 90.0f, 100.0f};
lNewSeries.mLineColor = Color{120, 220, 120, 255};
lChart.addSeries(lNewSeries);
// Remove a series (fades out and shrinks to center)
lChart.removeSeries(0);
// Series will animate out over several frames