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
| Option | Type | Default | Description |
|---|---|---|---|
x_column | str | "lap_number" | Column name for X-axis categories (e.g., 'lap_number', 'driver_name') |
y_column | str | "lap_time" | Column name for bar heights (e.g., 'lap_time', 'sector_1_time') |
data_source | Literal[laps, telemetry] | "laps" | Where to get data: 'laps' for lap metadata, 'telemetry' for aggregated telemetry Choices: laps, telemetry |
horizontal | bool | False | Create horizontal bars instead of vertical |
lap_selection | Literal[all, best, n_best] | "all" | Which laps to include: 'all', 'best', or 'n_best' Choices: all, best, n_best |
n_best_laps | int | 5 | Number of best laps when using 'n_best' selection |
title | str | None | "—" | Title displayed above the chart |
x_label | str | None | "—" | Custom label for X-axis (defaults to column name) |
y_label | str | None | "—" | Custom label for Y-axis (defaults to column name) |
format | Literal[png, svg] | "png" | Image format for output file Choices: png, svg |
dpi | int | 300 | Resolution for PNG output (dots per inch) |
figsize | tuple[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