# Interactive Charts with Plotly

> Building interactive, shareable charts and simple data apps in Python with Plotly Express and friends. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/data-analyst/python-viz-interactive
Last updated: 2026-11-28

Building interactive, shareable charts and simple data apps in Python with Plotly Express and friends.

Intermediate · about 4 hours · difficulty 2/5

Learn first: [Plotting in Python with Matplotlib and Seaborn](https://www.internhack.in/roadmaps/tracks/data-analyst/python-viz-static)

Interactive charts let readers hover for exact values, zoom into time ranges and toggle series. They are great for exploration and for sharing results with people who like to dig.

### Plotly Express

- One-line charts from DataFrames: `px.line(df, x="date", y="revenue", color="region")`.
- Hover data, facets (`facet_col`), animations over time (`animation_frame`), and maps.
- Export to standalone HTML with `fig.write_html("chart.html")` to share without any server.
- Works inside Jupyter, Colab and VS Code.

### Customising

Use `fig.update_layout` and `fig.update_traces` for titles, templates, axis formats and hover text. Keep the same design discipline as static charts: interactivity does not excuse clutter.

### Beyond single charts

- **Dash** (from Plotly) and **Streamlit** turn Python scripts into small web apps with filters and widgets. Handy for internal tools or a portfolio demo.
- **Altair** is a declarative alternative based on the grammar of graphics.

### When not to use interactivity

Slides, printed reports and executive emails need a static chart with the insight already highlighted. Do not make readers hunt for the point.

**Pitfall:** sharing huge HTML files with hundreds of thousands of points; aggregate first. Move on when you can build an interactive chart with meaningful hover text and share it as a single HTML file.

## Key concepts

- **Plotly Express basics**
- **Hover data and facets**
- **Exporting to HTML**
- **Layout and trace customisation**
- **Streamlit apps**
- **Dash apps**
- **Altair**

## Mini project

Build an animated Plotly scatter of Gapminder data (GDP per capita vs life expectancy by year, sized by population) and publish it as an HTML file in your portfolio repo.

## Check yourself

When would an interactive chart be the wrong choice for communicating a result?

## Free resources

- [Plotly Python graphing library](https://plotly.com/python/) (Plotly)
- [Streamlit documentation](https://docs.streamlit.io/) (Streamlit)

Previous: [Plotting in Python with Matplotlib and Seaborn](https://www.internhack.in/roadmaps/tracks/data-analyst/python-viz-static) · Next: [How BI Platforms Work](https://www.internhack.in/roadmaps/tracks/data-analyst/bi-concepts)

## More in Visualization: Principles and Libraries

- [Choosing the Right Chart](https://www.internhack.in/roadmaps/tracks/data-analyst/chart-selection)
- [Perception, Colour and Honest Design](https://www.internhack.in/roadmaps/tracks/data-analyst/visual-perception-color)
- [Dashboard Design](https://www.internhack.in/roadmaps/tracks/data-analyst/dashboard-design)
- [Plotting in Python with Matplotlib and Seaborn](https://www.internhack.in/roadmaps/tracks/data-analyst/python-viz-static)
- [Interactive Charts with Plotly](https://www.internhack.in/roadmaps/tracks/data-analyst/python-viz-interactive)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Analyst Roadmap](https://www.internhack.in/roadmaps/tracks/data-analyst)
