public class Dot extends ChartObject{ //public variables //private variables private float yVal; private color m_color; //distributional information private float m_margin; /****************************************** Getters ******************************************/ public color getColor(){ return m_color; }//end getColor public float getMean(){ return yVal; } public String getLabel(){ if(m_label!=null){ return m_label; } else{ return ""; } } /****************************************** Private Methods ******************************************/ /****************************************** Constructors ******************************************/ public Dot(float value,color barColor,float margin,int n){ yVal = value; m_color = barColor; m_margin = margin; }//end Bar public Dot(float value,color barColor,float margin,int n,String label){ yVal = value; m_color = barColor; m_label = label; x_tick = true; tickSize = DEFAULT_TICK_SIZE; m_margin = margin; }//end Bar /****************************************** Draw Method ******************************************/ public void draw(int curX,int barWidth,float startY,float endY,float dataMin,float dataMax){ float dataY = map(yVal,dataMin,dataMax,startY,endY); noStroke(); fill(m_color); //rect(curX,dataY,barWidth,startY-dataY); ellipse(curX+(barWidth/2.0),dataY,5,5); stroke(0); float margin1 = map(yVal+m_margin,dataMin,dataMax,startY,endY); line(curX,margin1,curX+barWidth-1,margin1); float margin2 = map(yVal-m_margin,dataMin,dataMax,startY,endY); line(curX,margin2,curX+barWidth-1,margin2); line(curX+(barWidth/2.0),margin1,curX+(barWidth/2.0),margin2); //line(curX,dataY,curX+barWidth,dataY); fill(0); if(x_tick){ line(curX+(barWidth/2.0),startY,curX+(barWidth/2.0),startY+tickSize); } if(m_label !=null){ text(m_label,curX+(barWidth/2.0)-(textWidth(m_label)/2.0),startY+tickSize+textAscent()); } }//draw }//end class