/** * Monthly subscription revenue. * * Drawn as inline SVG rather than with a charting library. Six bars need no * Chart.js, and pulling one in would be roughly thirty times the weight of * this entire screen. * * Amounts arrive already formatted by WooCommerce — the store's currency, * separator and symbol position live in its settings, and reimplementing * wc_price() here would get them wrong for every locale but the developer's. */ import { __, sprintf } from "@wordpress/i18n"; const HEIGHT = 132; const MIN_BAR = 2; export default function SalesChart({ chart }) { const months = chart.months || []; const peak = Math.max(...months.map((m) => m.total), 0); return (
{__("No subscription revenue yet. Bars appear once orders come in.", "subscription")}
) : (