(function(scope){

	scope.ChaosDashboardChart = function( args )
	{
		this.elemType = "DIV";
		this.Widget( args );
	}

	scope.ChaosDashboardChart.inherits( Widget )


	dojo.extend(scope.ChaosDashboardChart, {
    
        InitController: function()
        {
            this.controller = new ChartController(this.elem.id, this);
            this.zones.splice(0, 0, {name: 'All Zones', value: null});
            this.controller.setZones(this.zones);
        },
        
		UpdateChart: function(data)
		{
            data.range.begin = new Date(data.range.begin);
            data.range.end = new Date(data.range.end);

            this.controller.setData(data);
		},

		RequestUpdate: function(zone, begin, end, unit)
		{
            var data= {
                zone: zone,
                begin: begin.getTime(),
                end: end.getTime(),
                unit: unit
            };
            Send( this.id, "GetData", dojo.toJson(data) );
		}
	});
})(window);
