US inflation by quarter, 2019 to 2024
Inflation fell in seven of the nine quarters after its 2022 peak. A two-value color scale marks each quarter that came in below the one before.
{
"mark": "bar",
"data": "\u0000demo-fold:0",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
}
{
"mark": "bar",
"data": [
{
"date": "2019-01-01",
"rate": 1.6,
"phase": "Other quarters"
},
{
"date": "2019-04-01",
"rate": 2,
"phase": "Other quarters"
},
{
"date": "2019-07-01",
"rate": 1.8,
"phase": "Other quarters"
},
{
"date": "2019-10-01",
"rate": 1.8,
"phase": "Other quarters"
},
{
"date": "2020-01-01",
"rate": 2.5,
"phase": "Other quarters"
},
{
"date": "2020-04-01",
"rate": 0.3,
"phase": "Other quarters"
},
// … 18 more rows; Copy includes them
],
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
}import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
export function Example() {
return <Chart spec={spec} />;
}
import { Chart } from "@opendata-ai/openchart-react";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 24 rows; Copy includes them */];
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
export function Example() {
return <Chart spec={spec} />;
}
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
</script>
<template>
<Chart :spec="spec" />
</template>
<script setup lang="ts">
import { Chart } from "@opendata-ai/openchart-vue";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 24 rows; Copy includes them */];
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
</script>
<template>
<Chart :spec="spec" />
</template>
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
</script>
<Chart {spec} />
<script lang="ts">
import { Chart } from "@opendata-ai/openchart-svelte";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 24 rows; Copy includes them */];
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
</script>
<Chart {spec} />
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);
import { createChart } from "@opendata-ai/openchart-vanilla";
import type { ChartSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 24 rows; Copy includes them */];
const spec: ChartSpec = {
data,
"mark": "bar",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": {
"tickCount": 6
}
},
"y": {
"field": "rate",
"type": "quantitative",
"axis": {
"title": "CPI (year-over-year %)",
"format": ".0f",
"grid": true
}
},
"color": {
"field": "phase",
"type": "nominal",
"scale": {
"domain": [
"Fell from the quarter before",
"Other quarters"
],
"range": [
"#0e7490",
"#7a858f"
]
}
}
},
"labels": false,
"chrome": {
"title": "US inflation fell in seven of the nine quarters after its 2022 peak",
"subtitle": "Consumer price index, % change from a year earlier, quarterly, 2019–2024"
}
};
const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createChart(container, spec);