{"record":{"id":"0d47aa7b3b30b366","repo":"OpenBB-finance/OpenBB","slug":"failed-to-automatically-create-a-generic-chart-wit","errorCode":null,"errorMessage":"Failed to automatically create a generic chart with the data provided. -> {e} -> {e.args}","messagePattern":"Failed to automatically create a generic chart with the data provided\\. -> (.+?) -> (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"openbb_platform/obbject_extensions/charting/openbb_charting/charting.py","lineNumber":543,"sourceCode":"\n            if render and hasattr(fig, \"show\"):\n                fig.show(**kwargs)\n\n        except (RuntimeError, OpenBBError) as e:\n            raise e from e\n\n        except Exception:  # pylint: disable=W0718\n            try:\n                fig = self.create_line_chart(data=self._obbject.results, render=False, **kwargs)  # type: ignore\n                fig = self._set_chart_style(fig)  # type: ignore\n                content = fig.show(external=True, **kwargs).to_plotly_json()  # type: ignore\n                self._obbject.chart = Chart(\n                    fig=fig, content=content, format=self._format\n                )\n                if render:\n                    fig.show(**kwargs)  # type: ignore\n            except Exception as e:\n                raise RuntimeError(\n                    \"Failed to automatically create a generic chart with the data provided.\"\n                    + f\" -> {e} -> {e.args}\"\n                ) from e\n\n    # pylint: disable=too-many-locals,inconsistent-return-statements\n    def to_chart(\n        self,\n        data: (\n            Union[\n                list,\n                dict,\n                \"DataFrame\",\n                list[\"DataFrame\"],\n                \"Series\",\n                list[\"Series\"],\n                \"ndarray\",\n                Data,\n            ]","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/obbject_extensions/charting/openbb_charting/charting.py#L525-L561","documentation":"Charting's automatic charting path first tries the route-specific view, and on failure falls back to create_line_chart on the raw results; if that fallback also throws (nested exception captured in the message), this RuntimeError wraps the root cause. So the message text after '->' is the real failure - usually malformed data for a generic line chart (no index, no numeric columns, wrong types).","triggerScenarios":"Calling obbject.charting() where results are non-tabular (e.g. plain dicts, None, or objects basemodel_to_df cannot convert); the endpoint's view raised and the generic line chart also failed on the same data; results with all-nonnumeric columns.","commonSituations":"Auto-charting endpoints that return metadata objects rather than tables; empty results after a provider outage; custom DataModels without pandas-friendly fields.","solutions":["Read the embedded exception after '->' - it is the actual cause; fix that first","Convert results to a DataFrame yourself and pass it explicitly: obj.charting.to_chart(data=obj.to_df())","Verify the OBBject has non-empty, tabular results before calling .charting()"],"exampleFix":"# before\nres = obb.some.endpoint()\nres.charting()\n\n# after\nres = obb.some.endpoint()\nif res.results:\n    res.charting.to_chart(data=res.to_df())","handlingStrategy":"try-catch","validationCode":"df = res.to_df() if res.results is not None else None\nassert df is not None and not df.empty, 'no tabular results to chart'","typeGuard":null,"tryCatchPattern":"try:\n    res.charting()\nexcept RuntimeError as e:\n    if 'Failed to automatically create' in str(e):\n        logging.error('auto-chart failed: %s', e.args)  # root cause embedded after ->'","preventionTips":["Read the embedded exception after '->' to find the real cause","Convert results to DataFrame and call to_chart(data=df) explicitly","Validate results are non-empty and tabular before .charting()"],"tags":["openbb","charting","auto-chart","wrapped-exception"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}