var chart;
function ShowChart()
{
    var objChartDef = 
    {
        chart: {
            renderTo: 'divChart',
            defaultSeriesType: 'column',
            marginRight: 10,
            marginBottom: 48
        },
        title: {
            text: 'Cuyahoga County Monthly Transaction Total; Year-to-Year Comparison',
            x: -20 //center
        },
        yAxis: {
            title: {
                text: 'Total $ Sales'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.series.name +'</b><br/>'+
                '$' + Highcharts.numberFormat(this.y,0) + ' ';
            }
        },
		plotOptions: {
         column: {
            dataLabels: {
               enabled: true,
			   style: {fontSize: '8px'},
			   formatter: function() {
                  return '$' + Highcharts.numberFormat(this.y,0);
               }
            }
         }
        },
        credits: {
            enabled: false
        },
		dataLabels: {
            enabled: true,
			formatter: function() {
                  return this.y +'%';
               }
		},
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'top',
            x: -10,
            y: 40,
            borderWidth: 0
        }
    };
    objChartDef.xAxis = {
        title: {
            text: 'Month'
        },
        categories: [
		    'Jan', 
            'Feb', 
            'Mar', 
            'Apr', 
            'May', 
            'Jun', 
            'Jul', 
            'Aug', 
            'Sep', 
            'Oct', 
            'Nov', 
            'Dec'
		]
    };

    var nCount = g_aryPPW.length;
    var nYear = -1;
    objChartDef.series = [];
    for (var i = 0; i < nCount; i++)
    {
        if (g_aryPPW[i].year > 2009)
        {
            if (nYear != (g_aryPPW[i].year - 2010))
            {
                nYear =  g_aryPPW[i].year - 2010;
                objChartDef.series[nYear] = {};
                objChartDef.series[nYear].name = g_aryPPW[i].year;
                objChartDef.series[nYear].data = [0, 0, 0];
                objChartDef.series[nYear].length = 52;
            }
            objChartDef.series[nYear].data[(g_aryPPW[i].week - 1)] = g_aryPPW[i].amount;
        }
    }
    chart = new Highcharts.Chart(objChartDef);
};



var chart;
$(document).ready(function() {
   chart = new Highcharts.Chart({
      chart: {
         renderTo: 'container',
         defaultSeriesType: 'line',
         marginRight: 30,
         marginBottom: 40
      },
      title: {
         text: 'Transactions Per Year 2001 - 2011',
         x: -20 //center
      },
	  credits: {
            enabled: false
      },
      subtitle: {
         text: '',
         x: -20
      },
      xAxis: {
         categories: ['2002', '2003', '2004', '2005', 
            '2006', '2007', '2008', '2009', '2010', '2011']
      },
      yAxis: {
         title: {
            text: 'Sales Transactions'
         },
         plotLines: [{
            value: 0,
            width: 1,
            color: '#808080'
         }]
      },
      tooltip: {
         formatter: function() {
                   return '<b>'+ this.series.name +'</b><br/>'+
               this.x +': '+ this.y + ' Sales';
         }
      },
      legend: {
         layout: 'horizontal',
         align: 'right',
         verticalAlign: 'top',
         x: -120,
         y: 100,
         borderWidth: 0
      },
      series: [{
         name: 'Commercial',
         data: [1474, 1465, 1436, 1796, 2229, 2432, 2048, 1933, 2034, 5233]
      }, {
         name: 'Industrial',
         data: [327, 231, 278, 298, 345, 400, 274, 334, 396, 732]
      }]
   });
   
   
});

var chart;
$(document).ready(function() {
   chart = new Highcharts.Chart({
      chart: {
         renderTo: 'pieChart',
         plotBackgroundColor: null,
         plotBorderWidth: null,
		 marginRight: 20,
         marginLeft: 20,
         plotShadow: false
      },
      title: {
         text: 'Transaction by Zoning Type'
      },
	  credits: {
         enabled: false
	  },
      tooltip: {
         formatter: function() {
            return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
         }
      },
      plotOptions: {
         pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
               enabled: false
            },
            showInLegend: true
         }
      },
       series: [{
         type: 'pie',
         name: 'Percentage By Type',
         data: [
            ['Commercial',   83],
            ['Industrial',       17]
         ]
      }]
   });
});


