Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Nov 29, 2024
1 parent 2d364f6 commit aa65b5a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions vizro-ai/docs/pages/user-guides/add-generated-chart-usecase.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ This guide explains the different ways in which you can add a chart generated by

!!! example "Vizro-AI chart"
=== "Code for the cell"

```python
import vizro_ai
from vizro_ai import VizroAI
@@ -21,15 +22,18 @@ This guide explains the different ways in which you can add a chart generated by
df = px.data.gapminder()
vizro_ai = VizroAI(model="gpt-4o")

result = vizro_ai.plot(df,
"""Plot a bubble chart to show the changes in life expectancy
result = vizro_ai.plot(
df,
"""Plot a bubble chart to show the changes in life expectancy
and GDP per capita for each country over time.
Color the bubbles by continent.
Add animation on yearly basis, and do not use facets.
Put the legend on top""", return_elements=True)
Put the legend on top""",
return_elements=True,
)

print(f"Insight:\n{result.chart_insights}\n" )
print(f"Code explanation:\n{result.code_explanation}\n\nCode:\n{result.code_vizro}\n" )
print(f"Insight:\n{result.chart_insights}\n")
print(f"Code explanation:\n{result.code_explanation}\n\nCode:\n{result.code_vizro}\n")
result.get_fig_object(df).show()
```

0 comments on commit aa65b5a

Please sign in to comment.