That’s something you must do in your query.
For instance, in PostgreSQL this is typically done with window functions.
This adds accumulating sums to your query, besides many other possibilities. You can then plot this column in your visualizations.
Exactly. A simple example, assuming you use Postgres and are summing a
SELECT date_trunc('month', date_of_sale) "month", sum(sales), sum(sales) OVER (ORDER BY date_of_sale ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM sales_table GROUP BY 1