maxy=my;
scalex=sx;
scaley=sy;
if (drawBars){
PathIterator p=getPathIterator(null);
double[] v=new double[2];
double currentValue=Double.NEGATIVE_INFINITY;
if (p instanceof CurveIterator){
CurveIterator cu = (CurveIterator)p;
while(!cu.isDone()){
cu.currentSegment(v);
if (cu.currentSegmentIsValid){
int xpos = (int)Math.round(v[0]);
g2.drawLine(xpos, 0, xpos, -height);
// display a label on the bar
double value = cu.currentYSourceValue;
if (value!=currentValue){
currentValue=value;
String ySourceValue = new Double(currentValue).toString();
LabelShape label = new LabelShape(ySourceValue,xpos, -height, LabelShape.RIGHTUP, true);
label.draw(g2);
}
}
cu.next();
}
}
}else{
g2.draw(this);
if(showPoints){
Color oldColor = g2.getColor();
float[] hsbs = new float[3];
Color.RGBtoHSB(oldColor.getRed(), oldColor.getGreen(), oldColor.getBlue(), hsbs);
float bb=(float)((hsbs[2]+0.5)%1.0);
Color newColor = Color.getHSBColor(hsbs[0], hsbs[1], bb);
g2.setColor(newColor);
Stroke oldStroke = g2.getStroke();
g2.setStroke(new BasicStroke());
PathIterator p=getPathIterator(null);
if (p instanceof CurveIterator){
CurveIterator cu = (CurveIterator)p;
double[] v=new double[2];
while(!cu.isDone()){
cu.currentSegment(v);