Interactive graphs in Stata, created as self-contained HTML files.
One command. Zero dependencies. No Python. No R. No server.
ssc install sparkta, replace
Runs inside your existing do-file. No environment setup, no context switch.
A self-contained .html file. Email it, archive it, USB it. No viewer dependencies.
7 scatter fit types: lfit, qfit, lowess, exp, log, power, ma. Add fitci for a CI band that recomputes live with sliders.
Tableau, Okabe-Ito (colorblind-safe), viridis, neon and more. Dark/light variants: theme(dark_viridis).
The offline flag bundles all JS into the HTML. Zero network requests. Suitable for air-gapped systems.
filters(v1 v2 v3) adds dropdown menus. sliders(price mpg) adds dual-handle range controls. Stats panel updates live.
19 options: yline() xband() apoint() aellipse() alabelpos(). Lines, bands, markers, ellipses.
Bulk SFI reads, O(N) group scan, lazy sparklines. 10× faster than v2.x on large datasets.
t-distribution intervals computed in Java, matching ci means exactly. Any level 1–99.
All charts/graphs are real sparkta output from Stata's built-in auto and
nlsw88 datasets. Hover, click the legend, use the dropdowns —
everything is interactive.
All interactive chart/graph generation runs inside Stata on your local machine. The output HTML has no
data-fetching code, no callbacks, and makes zero external network requests. The
offline option embeds all JavaScript directly — suitable for
IRB-restricted data, clinical records, financial data, and institutional networks
that block external CDN requests. The file renders identically in any browser, years from now.
* Install net install sparkta, from("https://raw.githubusercontent.com/fahad-mirza/sparkta_stata/main/ado/") replace * Bar graph grouped by repair record sysuse auto, clear sparkta price, over(rep78) * CI bar graph -- t-distribution intervals matching ci means exactly sparkta price, type(cibar) over(rep78) cilevel(95) * Violin plot with animated KDE density sparkta price, type(violin) over(rep78) * Scatter with fit line, CI band, and live slider sparkta price mpg, type(scatter) fit(lfit) fitci sliders(mpg) * Unlimited live filters + range sliders sparkta price, over(rep78) filters(foreign headroom) sliders(mpg price) * Reference annotations -- line, band, point marker sparkta price, over(rep78) yline(6165) ylinelabel("Overall mean") /// yband(4000 8000) apoint(6165 3) * Dark theme with colorblind-safe palette sparkta price, over(rep78) theme(dark_viridis) * Fully air-gapped -- all JS embedded, zero network requests when opened sparkta price, type(cibar) over(rep78) offline export("~/secure/chart.html")