Change in each source's share of generation from six sources, 2016 to 2023
Gas gained the most share, 8.7 points, while coal lost 15. A bar column draws the 2023 shares beside the signed change.
Change in each source's share of generation from six sources, 2016 to 2023. This chart is drawn in the browser.
{
"type": "table",
"data": [
{
"source": "Gas",
"first": 34.8,
"last": 43.5,
"change": 8.7
},
{
"source": "Wind",
"first": 5.7,
"last": 10.1,
"change": 4.4
},
{
"source": "Solar",
"first": 1.4,
"last": 5.8,
"change": 4.4
},
{
"source": "Hydro",
"first": 6.6,
"last": 5.8,
"change": -0.8
},
{
"source": "Nuclear",
"first": 20.3,
"last": 18.6,
"change": -1.7
},
{
"source": "Coal",
"first": 31.2,
"last": 16.2,
"change": -15
}
],
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
}import { DataTable } from "@opendata-ai/openchart-react";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
export function Example() {
return <DataTable spec={spec} />;
}
import { DataTable } from "@opendata-ai/openchart-react";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 6 rows, as in the Spec tab; Copy includes them */];
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
export function Example() {
return <DataTable spec={spec} />;
}
<script setup lang="ts">
import { DataTable } from "@opendata-ai/openchart-vue";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
</script>
<template>
<DataTable :spec="spec" />
</template>
<script setup lang="ts">
import { DataTable } from "@opendata-ai/openchart-vue";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 6 rows, as in the Spec tab; Copy includes them */];
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
</script>
<template>
<DataTable :spec="spec" />
</template>
<script lang="ts">
import { DataTable } from "@opendata-ai/openchart-svelte";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
</script>
<DataTable {spec} />
<script lang="ts">
import { DataTable } from "@opendata-ai/openchart-svelte";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 6 rows, as in the Spec tab; Copy includes them */];
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
</script>
<DataTable {spec} />
import { createTable } from "@opendata-ai/openchart-vanilla";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:0";
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createTable(container, spec);
import { createTable } from "@opendata-ai/openchart-vanilla";
import type { TableSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 6 rows, as in the Spec tab; Copy includes them */];
const spec: TableSpec = {
data,
"type": "table",
"columns": [
{
"key": "source",
"label": "Source"
},
{
"key": "first",
"label": "2016 (%)",
"format": ".1f",
"align": "right"
},
{
"key": "last",
"label": "2023 (%)",
"format": ".1f",
"bar": {
"color": "#0e7490"
}
},
{
"key": "change",
"label": "Change (points)",
"format": "+.1f",
"align": "right"
}
],
"chrome": {
"title": "Gas gained the most share of generation from six sources, 8.7 points from 2016 to 2023",
"subtitle": "Share of US generation from six sources: coal, gas, nuclear, hydro, wind and solar, 2016 and 2023 (%)"
}
};
const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createTable(container, spec);