(function() {
	function getOption(xAxis, seriesData) {
		return option = {
			backgroundColor: '#fff5e9',
			grid: {
				x: 30,
				y: 20,
				x2: 40,
				y2: 30
			},
		    xAxis : [
		        {
		            type : 'category',
		            boundaryGap : false,
		            data : xAxis
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value'
		        }
		    ],
		    series : [
		        {
		            type:'line',
		            data: seriesData
		        }
		    ]
		};
	}
	
	var chart = echarts.init(document.getElementById('natureChart'))
	
	var natureChart = {
		init: function(data) {
			var xAxis = _.pluck(data,'name');
			var seriesData = _.pluck(data,'score')
			
			chart.setOption(getOption(xAxis, seriesData));
		}
	}
	
	window.natureChart = natureChart;
})()
