/* Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.geo.charting._Feature"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojox.geo.charting._Feature"] = true; dojo.provide("dojox.geo.charting._Feature"); dojo.require("dojox.gfx.fx"); dojo.declare("dojox.geo.charting._Feature", null, { _isZoomIn: false, _isFocused: false, markerText:null, constructor: function(parent, name, shapeData){ this.id = name; this.shape = parent.mapObj.createGroup(); this.parent = parent; this.mapObj = parent.mapObj; this._bbox = shapeData.bbox; this._center = shapeData.center; //TODO: fill color would be defined by charting data and legend //this._defaultFill = ["#FFCE52", "#CE6342", "#63A584"][Math.floor(Math.random() * 3)]; this._defaultFill = parent.defaultColor; this._highlightFill = parent.highlightColor; this._defaultStroke = { width: this._normalizeStrokeWeight(.5), color: "white" }; this._scale = Math.min(this.parent.containerSize.w / this._bbox.w, this.parent.containerSize.h / this._bbox.h); var shapes = (dojo.isArray(shapeData.shape[0])) ? shapeData.shape : [shapeData.shape]; dojo.forEach(shapes, function(points){ this.shape.createPolyline(points).setStroke(this._defaultStroke).setFill(this._defaultFill); }, this); }, setValue:function(value){ this.value = value; if(this.parent.series.length != 0){ for(var i = 0;i < this.parent.series.length;i++){ var range = this.parent.series[i]; if((value>=range.min)&&(value