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
aMode - Visualization mode (OVERLAPPED, STACKED, or PERCENT)
rStyle - Optional style configuration
Chart Modes
enumclassRLAreaChartMode {
OVERLAPPED, // Areas overlap with transparency showing layering
STACKED, // Areas stack on top of each other
PERCENT // 100% stacked (normalized to percentage)
};
Mode Descriptions
Mode
Description
Use Case
OVERLAPPED
Series overlap with transparency
Comparing trends across series
STACKED
Series stack vertically
Showing cumulative totals
PERCENT
Normalized to 100%
Showing proportions over time
Data Structures
Series Data
structRLAreaSeries {
std::vector<float> mValues; // Data points
Color mColor{80, 180, 255, 255}; // Series color
std::string mLabel; // Legend labelfloatmAlpha{0.6f}; // Fill opacity (0.0 - 1.0)
};
Style Configuration
structRLAreaChartStyle {
// Background and gridboolmShowBackground{true};
Color mBackground{20, 22, 28, 255};
boolmShowGrid{true};
Color mGridColor{40, 44, 52, 255};
intmGridLines{5};
// Axes
Color mAxisColor{180, 180, 180, 255};
Color mLabelColor{200, 200, 200, 255};
// Chart areafloatmPadding{40.0f};
floatmLineThickness{2.0f};
boolmShowPoints{false};
floatmPointRadius{4.0f};
// LabelsboolmShowLabels{true};
Font mLabelFont{};
intmLabelFontSize{12};
// LegendboolmShowLegend{true};
// AnimationboolmSmoothAnimate{true};
floatmAnimateSpeed{6.0f};
};
// Use overlapped mode for comparing trends
RLAreaChart lChart(lBounds, RLAreaChartMode::OVERLAPPED);
// Set lower alpha for better overlap visibilityfor (auto& rSeries : lData) {
rSeries.mAlpha = 0.5f;
}
lChart.setData(lData);
100% Stacked (Percent Mode)
// Show proportions over time
RLAreaChart lChart(lBounds, RLAreaChartMode::PERCENT);
lChart.setData(lData); // Values automatically normalized to 100%
Smooth Data Transitions
// Initial data
lChart.setData(lInitialData);
// Later, smoothly transition to new data
lChart.setTargetData(lNewData);
// In main loop - animation happens automatically
lChart.update(lDt);