- Low-level API:
import plotly.graph_objects as go - Build trace-by-trace:
go.Scatter(), go.Bar() - Combine multiple trace types in one figure
- Use when Plotly Express limits are reached
fig.add_trace(go.Scatter(...)) to layer traces- Mix bar and line charts on the same axes
- Add reference lines:
fig.add_hline(y=target) - Secondary y-axis via
secondary_y=True
updatemenus in fig.update_layout()- Toggle trace visibility or change chart type
- Buttons or dropdowns — configure with
type param - Enable viewers to self-serve analysis without code
fig.update_xaxes(rangeslider_visible=True)- Quick-select buttons: 1M, 3M, 6M, YTD, 1Y, All
- Essential for long time-series financial data
rangeselector dict for custom button configuration
animation_frame + animation_group for tracking- Transition:
frame.duration, transition.duration - Animated scatter shows bubble charts over time
- Stable axis ranges prevent jarring scale jumps
- Part A: Multi-metric performance dashboard with dropdowns
- Part B: Animated market share evolution bubble chart
- Add range slider to a time-series financial chart
- Combine bar and line traces on secondary y-axis