/**
条形统计图容器
width:统计图宽度(>=100);
height:统计图高度(>=450);
left:统计图左边距;
top:统计图上边距;
title:统计图标题(默认值:统计图);
unit:统计图单位(默认值:个);
bgcolor:统计图背景颜色(默认值:#CCFFCC);
divID:统计图层ID(默认值:div_chart)
*/
function chart(width,height,left,top,title,unit,bgcolor,divID){
this.width=(width<100||width>2000)?100:width
this.height=(height<450||height>2000)?450:height
this.left=left?((left<0||left>800)?0:left):0
this.top=top?((top<0||top>800)?0:top):0
this.title=title?title:"统计图"
this.unit=unit?unit:"个"
this.bgcolor=bgcolor?bgcolor:"#CCFFCC"
this.divID=divID?divID:"div_chart"
this.columns=new Array()
this.columnCount=0
this.gradLeft=0
this.gradTop=this.top+20
this.gradHeight=this.height-120
this.gradInterval=(this.gradHeight)/11
this.maxValue=0
this.colWidth=25
this.colGap=this.colWidth
}
/**
给条形统计图加一条形,然后计算相应的值
*/
function chart.prototype.addColumn(size,footnote,color){
var columnObj= new column(size,footnote,color)
if(columnObj.size>this.maxValue){