Skip to main content

BarChartAnalyzer

Bar chart for comparing lap times, sector times, or other metrics across laps

Configuration

  • Metadata Only: False

When to Use

  • User wants to compare lap times visually
  • User asks for a bar chart of sector times
  • User needs categorical data visualization

Options

OptionTypeDefaultDescription
x_columnstr"lap_number"Column name for X-axis categories (e.g., 'lap_number', 'driver_name')
y_columnstr"lap_time"Column name for bar heights (e.g., 'lap_time', 'sector_1_time')
data_sourceLiteral[laps, telemetry]"laps"Where to get data: 'laps' for lap metadata, 'telemetry' for aggregated telemetry Choices: laps, telemetry
horizontalboolFalseCreate horizontal bars instead of vertical
lap_selectionLiteral[all, best, n_best]"all"Which laps to include: 'all', 'best', or 'n_best' Choices: all, best, n_best
n_best_lapsint5Number of best laps when using 'n_best' selection
titlestr | None"—"Title displayed above the chart
x_labelstr | None"—"Custom label for X-axis (defaults to column name)
y_labelstr | None"—"Custom label for Y-axis (defaults to column name)
formatLiteral[png, svg]"png"Image format for output file Choices: png, svg
dpiint300Resolution for PNG output (dots per inch)
figsizetuple[float, float](12, 8)Figure dimensions in inches (width, height)

Examples

Example 1

User Query: Show a bar chart of my lap times

Call:

analyze(analyzers='bar_chart', event='01H8SP4HK4')

Explanation: Creates bar chart with lap_number on x-axis and lap_time on y-axis

Example 2

User Query: Create a bar chart comparing sector 1 times

Call:

analyze(analyzers='bar_chart', event='01H8SP4HK4', y_column='sector_1_time')

Explanation: Bar chart showing sector 1 times for each lap