document.getElementById('local_graph').style.display='block';
document.getElementById('graph_title').innerHTML='State Averages for VT';
document.getElementById('bar_graph2').innerHTML = "";
document.getElementById('holder2').innerHTML = "";
Highcharts.setOptions({
lang: {
numericSymbols: ['k', 'M', 'B', 'T', 'P', 'E']
},
credits: {
enabled: false
},
chart: {
height: 250,
backgroundColor: null,
plotBackgroundColor: null,
plotShadow: true,
},
title: {
style: {
color: '#666',
fontFamily: '"Helvetica Neue", Helvetica, Arial, sans-serif',
fontSize: '14px'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
backgroundColor: 'none',
borderColor: 'none',
borderWidth: 0,
itemStyle: {'color': '#444', 'fontWeight': 'normal'},
itemHoverStyle: {color: '#aaa'},
itemMarginBottom: 10,
width: 145
},
plotOptions: {
series: {}
},
exporting: {
sourceWidth: 850,
buttons: {
contextButton: {
text: 'Download',
x: 5,
y: -10,
theme: {
fill: '#fff',
r: 5,
padding: 5,
states: {
hover: {stroke: '#7a7a7a', fill: '#fff'},
select: {stroke: '#7a7a7a', fill: '#fff'}
}
}
}
}
}
});
// set ELECTRICITY SOURCES chart options
var electricitySourcesData = [{name: "Nuclear", y: 71.97, color: "#8bbc21"},{name: "Hydro", y: 16.72, color: "#ECC30B"},{name: "Biomass", y: 6.44, color: "#492970"},{name: "Wind", y: 4.43, color: "#8085e9"},{name: "Solar", y: 0.33, color: "#E501CE"},{name: "Oil", y: 0.08, color: "#E55C01"},{name: "Gas", y: 0.04, color: "#910000"}];
var electricitySourcesChartOptions = {
chart: {
renderTo: 'holder2',
width: 340
},
title: {
text: "Electricity Sources",
align: 'left'
},
legend: {
width: 135,
itemStyle: {fontSize: '10px'},
verticalAlign: 'bottom',
labelFormatter: function () {
if (this.y == null || this.y < 0) this.y = 0;
if (this.y !== null) {
return '' + this.name + ': ' + this.y.toFixed(2) + '%';
}
}
},
series: [
{
type: 'pie',
data: electricitySourcesData
}
],
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
},
},
tooltip: {
formatter: function() {
return '' + this.point.name + ': ' + Highcharts.numberFormat(this.y, 2) + '%';
}
},
exporting: {
enabled: false
}
};
// set ELECTRIC VEHICLE EMISSIONS chart options
var electricVehicleEmissionsData = [8,3304,6258,11435];
var electricVehicleEmissionsChartOptions = {
chart: {
renderTo: 'bar_graph2',
type: 'column',
width: 278
},
title: {
text: "Annual Emissions per Vehicle",
},
series: [
{ data: electricVehicleEmissionsData }
],
tooltip: {
headerFormat: '{point.key}
',
pointFormat: '{point.y} pounds
of CO2 equivalent'
},
legend: {
enabled: false
},
yAxis: {
min: 0,
title: {
text: 'Pounds of CO2 Equivalent',
style: {
color: '#666',
fontFamily: '"Helvetica Neue", Helvetica, Arial, sans-serif',
fontSize: '12px',
fontWeight: 'normal'
}
}
},
xAxis : {
categories: ['All Electric', 'Plug-in Hybrid', 'Hybrid', 'Gasoline'],
crosshair: true
},
exporting: {
enabled: false
}
};
// render ELECTRICITY SOURCES chart
var holder2 = new Highcharts.Chart(electricitySourcesChartOptions);
// render ELECTRIC VEHICLE EMISSIONS chart
var bar_graph2 = new Highcharts.Chart(electricVehicleEmissionsChartOptions);