Francisco Guardado

Datagov Chart

Source: U.S. Bureau of Labor Statistics (BLS) via data.gov  ·  0 data points

Trend: Unemployment Rate (%)

Loading BLS data…
Download full dataset as CSV

Details: Drupal module: francisco_datagov_chart

-REST controller at /api/datagov-chart: makes a single POST to the BLS Public Data API (no key needed, part of data.gov) fetching two series simultaneously: LNS14000000 (Unemployment Rate, seasonally adjusted) and CUUR0000SA0 (CPI-U All Items). Correlates them by month, sorts by date, and returns clean JSON.

-datagov_chart paragraph type with 6 CMS-configurable fields (field_dg_label, field_dg_chart_type, field_dg_limit, field_dg_api_path, field_dg_csv_path, field_dg_source), same pattern as the NASA chart, nothing hardcoded.

-Auto-registers on all content types with field_components on install.

Details: Next.js component: DataGovChart

-Bar chart: monthly unemployment rate, bars color-coded green/yellow/orange/red by severity with a 4% dashed reference line and a color legend below.

-Line chart: unemployment trend over time, same reference line, connectNulls for any gaps.

-Scatter chart: each dot is one month: unemployment rate (X axis) vs CPI-U index (Y axis), letting you see how inflation and employment correlate.

-Cyan accent (#06b6d4) to visually distinguish it from the NASA chart's orange.

-CSV download builds the file dynamically from the same endpoint, no separate Drupal view needed.

-Tooltip shows full month name, unemployment %, and CPI value.