83 lines
1.8 KiB
HTML
Executable File
83 lines
1.8 KiB
HTML
Executable File
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<script>
|
|
window.onload = function () {
|
|
|
|
var chart = new CanvasJS.Chart("chartContainer", {
|
|
animationEnabled: true,
|
|
title:{
|
|
text: "Crude Oil Reserves vs Production, 2016"
|
|
},
|
|
axisY: {
|
|
title: "Billions of Barrels",
|
|
titleFontColor: "#4F81BC",
|
|
lineColor: "#4F81BC",
|
|
labelFontColor: "#4F81BC",
|
|
tickColor: "#4F81BC"
|
|
},
|
|
axisY2: {
|
|
title: "Millions of Barrels/day",
|
|
titleFontColor: "#C0504E",
|
|
lineColor: "#C0504E",
|
|
labelFontColor: "#C0504E",
|
|
tickColor: "#C0504E"
|
|
},
|
|
toolTip: {
|
|
shared: true
|
|
},
|
|
legend: {
|
|
cursor:"pointer",
|
|
itemclick: toggleDataSeries
|
|
},
|
|
data: [{
|
|
type: "column",
|
|
name: "Proven Oil Reserves (bn)",
|
|
legendText: "Proven Oil Reserves",
|
|
showInLegend: true,
|
|
dataPoints:[
|
|
{ label: "Saudi", y: 266.21 },
|
|
{ label: "Venezuela", y: 302.25 },
|
|
{ label: "Iran", y: 157.20 },
|
|
{ label: "Iraq", y: 148.77 },
|
|
{ label: "Kuwait", y: 101.50 },
|
|
{ label: "UAE", y: 97.8 }
|
|
]
|
|
},
|
|
{
|
|
type: "column",
|
|
name: "Oil Production (million/day)",
|
|
legendText: "Oil Production",
|
|
axisYType: "secondary",
|
|
showInLegend: true,
|
|
dataPoints:[
|
|
{ label: "Saudi", y: 10.46 },
|
|
{ label: "Venezuela", y: 2.27 },
|
|
{ label: "Iran", y: 3.99 },
|
|
{ label: "Iraq", y: 4.45 },
|
|
{ label: "Kuwait", y: 2.92 },
|
|
{ label: "UAE", y: 3.1 }
|
|
]
|
|
}]
|
|
});
|
|
chart.render();
|
|
|
|
function toggleDataSeries(e) {
|
|
if (typeof(e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
|
|
e.dataSeries.visible = false;
|
|
}
|
|
else {
|
|
e.dataSeries.visible = true;
|
|
}
|
|
chart.render();
|
|
}
|
|
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="chartContainer" style="height: 370px; max-width: 920px; margin: 0px auto;"></div>
|
|
<script src="../../canvasjs.min.js"></script>
|
|
</body>
|
|
</html> |