-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart34.html
More file actions
35 lines (33 loc) · 9.94 KB
/
chart34.html
File metadata and controls
35 lines (33 loc) · 9.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<style>
.error {
color: red;
}
</style>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm//vega@5"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm//vega-lite@4.17.0"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm//vega-embed@6"></script>
</head>
<body>
<div id="vis"></div>
<script>
(function(vegaEmbed) {
var spec = {"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, "hconcat": [{"mark": {"type": "bar", "size": 30}, "encoding": {"color": {"field": "AER Fuel Type Code", "type": "nominal"}, "tooltip": [{"field": "YEAR", "type": "quantitative"}, {"field": "AER Fuel Type Code", "type": "nominal"}, {"field": "Netgen value", "format": ",", "title": "Power Generated MWh", "type": "ordinal"}], "x": {"field": "YEAR", "type": "ordinal"}, "y": {"field": "Netgen value", "title": "Power Genered in MWh", "type": "quantitative"}}, "height": 300, "title": ["Power Generated from Each Fuel Source", "\nin MWh"], "width": 300}, {"mark": {"type": "bar", "size": 30}, "encoding": {"color": {"field": "AER Fuel Type Code", "type": "nominal"}, "tooltip": [{"field": "YEAR", "type": "quantitative"}, {"field": "AER Fuel Type Code", "type": "nominal"}, {"field": "Pct_of_Total", "format": ".0%", "title": "% of Total", "type": "quantitative"}], "x": {"field": "YEAR", "type": "ordinal"}, "y": {"field": "Netgen value", "stack": "normalize", "title": "% of Annual Total", "type": "quantitative"}}, "height": 300, "title": ["Power Generated from Each Fuel Source", "\n as % of Total"], "width": 300}], "data": {"name": "data-a31531339b3d5f4a9780263543c20ee3"}, "$schema": "https://vega.github.io/schema/vega-lite/v4.17.0.json", "datasets": {"data-a31531339b3d5f4a9780263543c20ee3": [{"YEAR": 2014, "AER Fuel Type Code": "Coal ", "Netgen value": 1570472353.6679962, "Pct_of_Total": 0.3841453381972566}, {"YEAR": 2014, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 259341221.37699974, "Pct_of_Total": 0.06343615088904532}, {"YEAR": 2014, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1123177721.3030014, "Pct_of_Total": 0.27473484942147447}, {"YEAR": 2014, "AER Fuel Type Code": "Nuclear", "Netgen value": 797165982, "Pct_of_Total": 0.19499075869722432}, {"YEAR": 2014, "AER Fuel Type Code": "Other", "Netgen value": 97057844.73800063, "Pct_of_Total": 0.023740830906379726}, {"YEAR": 2014, "AER Fuel Type Code": "Solar", "Netgen value": 17555915.59000006, "Pct_of_Total": 0.004294264153031232}, {"YEAR": 2014, "AER Fuel Type Code": "Wind", "Netgen value": 181204220.09000018, "Pct_of_Total": 0.044323452270054284}, {"YEAR": 2014, "AER Fuel Type Code": "Wood", "Netgen value": 42249164.41199988, "Pct_of_Total": 0.010334355465534186}, {"YEAR": 2015, "AER Fuel Type Code": "Coal ", "Netgen value": 1338259200.8360014, "Pct_of_Total": 0.32986449457021316}, {"YEAR": 2015, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 249031834.64300042, "Pct_of_Total": 0.06138329571363284}, {"YEAR": 2015, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1319884315.9080055, "Pct_of_Total": 0.32533531059316834}, {"YEAR": 2015, "AER Fuel Type Code": "Nuclear", "Netgen value": 797177877, "Pct_of_Total": 0.19649457841566925}, {"YEAR": 2015, "AER Fuel Type Code": "Other", "Netgen value": 95935031.50500008, "Pct_of_Total": 0.02364680972057249}, {"YEAR": 2015, "AER Fuel Type Code": "Solar", "Netgen value": 24745421.529999983, "Pct_of_Total": 0.006099443187703228}, {"YEAR": 2015, "AER Fuel Type Code": "Wind", "Netgen value": 190640671.90000004, "Pct_of_Total": 0.04699058959694441}, {"YEAR": 2015, "AER Fuel Type Code": "Wood", "Netgen value": 41322452.53200009, "Pct_of_Total": 0.010185478202096246}, {"YEAR": 2016, "AER Fuel Type Code": "Coal ", "Netgen value": 1230022443.9009957, "Pct_of_Total": 0.3018113759468374}, {"YEAR": 2016, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 267812153.0750014, "Pct_of_Total": 0.06571323540935087}, {"YEAR": 2016, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1377449397.761, "Pct_of_Total": 0.3379856197720339}, {"YEAR": 2016, "AER Fuel Type Code": "Nuclear", "Netgen value": 805693948, "Pct_of_Total": 0.19769362765992923}, {"YEAR": 2016, "AER Fuel Type Code": "Other", "Netgen value": 90671133.14999928, "Pct_of_Total": 0.022248032619527413}, {"YEAR": 2016, "AER Fuel Type Code": "Solar", "Netgen value": 35944978.22000001, "Pct_of_Total": 0.00881984177504204}, {"YEAR": 2016, "AER Fuel Type Code": "Wind", "Netgen value": 226926387.56999987, "Pct_of_Total": 0.0556810695697026}, {"YEAR": 2016, "AER Fuel Type Code": "Wood", "Netgen value": 40947025.51900012, "Pct_of_Total": 0.01004719724757673}, {"YEAR": 2017, "AER Fuel Type Code": "Coal ", "Netgen value": 1195516522.5459983, "Pct_of_Total": 0.2965683856052435}, {"YEAR": 2017, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 300325493.2469989, "Pct_of_Total": 0.0745008914629484}, {"YEAR": 2017, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1295380116.8050003, "Pct_of_Total": 0.3213412635802443}, {"YEAR": 2017, "AER Fuel Type Code": "Nuclear", "Netgen value": 804949635, "Pct_of_Total": 0.19968156796117806}, {"YEAR": 2017, "AER Fuel Type Code": "Other", "Netgen value": 86620040.37800027, "Pct_of_Total": 0.02148758720729111}, {"YEAR": 2017, "AER Fuel Type Code": "Solar", "Netgen value": 53135331.39999997, "Pct_of_Total": 0.013181130628239631}, {"YEAR": 2017, "AER Fuel Type Code": "Wind", "Netgen value": 254211174.58999962, "Pct_of_Total": 0.0630614435092997}, {"YEAR": 2017, "AER Fuel Type Code": "Wood", "Netgen value": 41028123.77199995, "Pct_of_Total": 0.01017773004555525}, {"YEAR": 2018, "AER Fuel Type Code": "Coal ", "Netgen value": 1140412969.5549998, "Pct_of_Total": 0.27293855225034974}, {"YEAR": 2018, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 292523988.93499976, "Pct_of_Total": 0.07001066821396369}, {"YEAR": 2018, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1469132682.369991, "Pct_of_Total": 0.35161205466315043}, {"YEAR": 2018, "AER Fuel Type Code": "Nuclear", "Netgen value": 807084477, "Pct_of_Total": 0.19316201637207603}, {"YEAR": 2018, "AER Fuel Type Code": "Other", "Netgen value": 91694300.37300006, "Pct_of_Total": 0.021945479630226482}, {"YEAR": 2018, "AER Fuel Type Code": "Solar", "Netgen value": 63825314.533999965, "Pct_of_Total": 0.015275509320654922}, {"YEAR": 2018, "AER Fuel Type Code": "Wind", "Netgen value": 272667453.71500015, "Pct_of_Total": 0.0652583424159069}, {"YEAR": 2018, "AER Fuel Type Code": "Wood", "Netgen value": 40936158.92200004, "Pct_of_Total": 0.009797377133671818}, {"YEAR": 2019, "AER Fuel Type Code": "Coal ", "Netgen value": 958047860.6639999, "Pct_of_Total": 0.23209337799753507}, {"YEAR": 2019, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 287873730.5249997, "Pct_of_Total": 0.0697392993581682}, {"YEAR": 2019, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1585814174.0420043, "Pct_of_Total": 0.3841738848774093}, {"YEAR": 2019, "AER Fuel Type Code": "Nuclear", "Netgen value": 809409262, "Pct_of_Total": 0.1960847025636816}, {"YEAR": 2019, "AER Fuel Type Code": "Other", "Netgen value": 80347499.6149999, "Pct_of_Total": 0.019464708773919093}, {"YEAR": 2019, "AER Fuel Type Code": "Solar", "Netgen value": 71936822.2420001, "Pct_of_Total": 0.017427167015416516}, {"YEAR": 2019, "AER Fuel Type Code": "Wind", "Netgen value": 295882483.4989998, "Pct_of_Total": 0.0716794722948263}, {"YEAR": 2019, "AER Fuel Type Code": "Wood", "Netgen value": 38543382.111000106, "Pct_of_Total": 0.009337387119044088}, {"YEAR": 2020, "AER Fuel Type Code": "Coal ", "Netgen value": 767511977.4070026, "Pct_of_Total": 0.19153631904243856}, {"YEAR": 2020, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 285273894.8890003, "Pct_of_Total": 0.07119147759822324}, {"YEAR": 2020, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1624166869.5069928, "Pct_of_Total": 0.40531868277422894}, {"YEAR": 2020, "AER Fuel Type Code": "Nuclear", "Netgen value": 789878863, "Pct_of_Total": 0.19711808331587646}, {"YEAR": 2020, "AER Fuel Type Code": "Other", "Netgen value": 76956762.8989997, "Pct_of_Total": 0.019204931681840908}, {"YEAR": 2020, "AER Fuel Type Code": "Solar", "Netgen value": 89198715.12099916, "Pct_of_Total": 0.022259969955532588}, {"YEAR": 2020, "AER Fuel Type Code": "Wind", "Netgen value": 337938049.03099966, "Pct_of_Total": 0.08433407149483038}, {"YEAR": 2020, "AER Fuel Type Code": "Wood", "Netgen value": 36210335.94700009, "Pct_of_Total": 0.009036464137028868}, {"YEAR": 2021, "AER Fuel Type Code": "Coal ", "Netgen value": 891706556.679999, "Pct_of_Total": 0.21666817069178854}, {"YEAR": 2021, "AER Fuel Type Code": "Hydroelectric", "Netgen value": 260224885.57099986, "Pct_of_Total": 0.0632298254428807}, {"YEAR": 2021, "AER Fuel Type Code": "Natural Gas", "Netgen value": 1575229808.0530005, "Pct_of_Total": 0.3827516556576153}, {"YEAR": 2021, "AER Fuel Type Code": "Nuclear", "Netgen value": 778151500, "Pct_of_Total": 0.18907639599938025}, {"YEAR": 2021, "AER Fuel Type Code": "Other", "Netgen value": 78611465.02500011, "Pct_of_Total": 0.019101129395957407}, {"YEAR": 2021, "AER Fuel Type Code": "Solar", "Netgen value": 114678238.70800003, "Pct_of_Total": 0.027864687113582986}, {"YEAR": 2021, "AER Fuel Type Code": "Wind", "Netgen value": 379767247.34199965, "Pct_of_Total": 0.09227640433261455}, {"YEAR": 2021, "AER Fuel Type Code": "Wood", "Netgen value": 37170453.10200005, "Pct_of_Total": 0.009031731366180176}]}};
var embedOpt = {"mode": "vega-lite"};
function showError(el, error){
el.innerHTML = ('<div class="error" style="color:red;">'
+ '<p>JavaScript Error: ' + error.message + '</p>'
+ "<p>This usually means there's a typo in your chart specification. "
+ "See the javascript console for the full traceback.</p>"
+ '</div>');
throw error;
}
const el = document.getElementById('vis');
vegaEmbed("#vis", spec, embedOpt)
.catch(error => showError(el, error));
})(vegaEmbed);
</script>
</body>
</html>