OpenBB-finance/OpenBB · error · RuntimeError
Error: No data to plot.
Error message
Error: No data to plot.
What it means
The Relative Rotation Chart (RRG) view raises this RuntimeError when either the rs_ratios or rs_momentum DataFrame converted from the OBBject is empty. RRG plots need both the relative-strength ratio and momentum series for the comparison universe; empty results (e.g. the upstream relative_rotation endpoint returned nothing for the benchmark/date range) leave nothing to plot.
Source
Thrown at openbb_platform/extensions/technical/openbb_technical/technical_views.py:354
# pylint: disable=import-outside-toplevel
from openbb_charting.charts import relative_rotation # noqa
from openbb_charting.core.chart_style import ChartStyle # noqa
from openbb_charting.core.openbb_figure import OpenBBFigure # noqa
from openbb_core.app.utils import basemodel_to_df # noqa
ratios_df = basemodel_to_df(kwargs["obbject_item"].rs_ratios, index="date") # type: ignore
momentum_df = basemodel_to_df(kwargs["obbject_item"].rs_momentum, index="date") # type: ignore
benchmark_symbol = kwargs["obbject_item"].benchmark # type: ignore
study = kwargs.get("study")
study = str(kwargs["obbject_item"].study) if study is None else str(study)
show_tails = kwargs.get("show_tails")
show_tails = True if show_tails is None else show_tails
tail_periods = int(kwargs.get("tail_periods")) if "tail_periods" in kwargs else 16 # type: ignore
tail_interval = str(kwargs.get("tail_interval")) if "tail_interval" in kwargs else "week" # type: ignore
date = kwargs.get("date") if "date" in kwargs else None # type: ignore
show_tails = False if date is not None else show_tails
if ratios_df.empty or momentum_df.empty:
raise RuntimeError("Error: No data to plot.")
if show_tails is True:
fig = relative_rotation.create_rrg_with_tails(
ratios_df,
momentum_df,
study,
benchmark_symbol,
tail_periods,
tail_interval, # type: ignore
)
if show_tails is False:
fig = relative_rotation.create_rrg_without_tails(
ratios_df,
momentum_df,
benchmark_symbol,
study,
date, # type: ignoreView on GitHub (pinned to 3e071fcc2c)
Solutions
- Check res.extra['metadata'] or res.results fields for emptiness before charting: assert res.rs_ratios and res.rs_momentum
- Widen the date range or use a well-covered benchmark/symbol set
- Verify the symbols were valid by inspecting the raw OBBject results before calling .charting()
Example fix
# before res = obb.technical.relative_rotation(...) res.charting() # after res = obb.technical.relative_rotation(...) assert res.rs_ratios and res.rs_momentum, 'RRG data empty; adjust symbols/dates' res.charting()
Defensive patterns
Strategy: validation
Validate before calling
res = obb.technical.relative_rotation(...)
if not res.results or not getattr(res.results, 'rs_ratios', None) or not getattr(res.results, 'rs_momentum', None):
raise RuntimeError('no RRG data; check symbols and date range') Try / catch
try:
res.charting()
except RuntimeError as e:
if 'No data to plot' in str(e):
logging.warning('RRG returned empty series; retrying with wider dates') Prevention
- Assert both rs_ratios and rs_momentum are non-empty before charting
- Use liquid benchmarks and well-covered symbols
- Check provider coverage for the requested date
When it happens
Trigger: Calling chart/relative_rotation (or .charting() on a relative rotation OBBject) where the provider returned zero rows for rs_ratios or rs_momentum; symbol universe empty for the requested date; benchmark symbol invalid so all ratio computations were dropped.
Common situations: Requesting an RRG with a date too old/new for provider coverage; provider API returning an empty payload silently; symbols parameter that matched no providers.
Related errors
- Error: No data to plot.
- No data was found in the DataFrame.
- OBBject Extension Error -> An OBBject extension that acts
- [Empty] -> {e}
- Expiration field not found in the data.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/c07e307b4f518aff.
Report an issue: GitHub.