M
morc
hey
I've made a dynamic graphing system using java.awt. The values on the
y-axis are dynmacilay generated from the database. Like so :
public void scaleYAxis(Graphics g,String ticker){
double high = getHigh(ticker);
double low = getLow(ticker);
high = Math.round(high*10000.0)/10000.0;
low = Math.round(low*10000.0)/10000.0;
double increment = (high-low)/4;
double tenPer = high*0.10;
// System.out.println("high:"+high+" low:"+low+" tenPer:"+tenPer+"
Increment:"+increment);
double zero = Math.round((low-increment)*10000.0)/10000.0;
double second = Math.round((low+increment)*10000.0)/10000.0;
double third = Math.round((second+increment)*10000.0)/10000.0;
double fourth = Math.round((third+increment)*10000.0)/10000.0;
double fifth = Math.round((fourth+increment)*10000.0)/10000.0;
//System.out.println("zero:"+zero+" first:"+low+" second:"+second+"
third:"+third+" fourth:"+fourth+" fifth:"+fifth);
g.drawString("($)",0,225);
g.drawLine(50,40,50,350);
g.drawString(Double.toString(low),10,300);
g.drawString(Double.toString(second),10,250);
g.drawString(Double.toString(third),10,200);
g.drawString(Double.toString(fourth),10,150);
g.drawString(Double.toString(fifth),10,100);
}
Now i need help devising a formula for a seperate function in which it
takes the value from the db and converts it to coordinates ont ehs cale
in the right spot.
I hope i made sense
Any suggestions are greatly appreciated.
Thanks in adavance
-morc
I've made a dynamic graphing system using java.awt. The values on the
y-axis are dynmacilay generated from the database. Like so :
public void scaleYAxis(Graphics g,String ticker){
double high = getHigh(ticker);
double low = getLow(ticker);
high = Math.round(high*10000.0)/10000.0;
low = Math.round(low*10000.0)/10000.0;
double increment = (high-low)/4;
double tenPer = high*0.10;
// System.out.println("high:"+high+" low:"+low+" tenPer:"+tenPer+"
Increment:"+increment);
double zero = Math.round((low-increment)*10000.0)/10000.0;
double second = Math.round((low+increment)*10000.0)/10000.0;
double third = Math.round((second+increment)*10000.0)/10000.0;
double fourth = Math.round((third+increment)*10000.0)/10000.0;
double fifth = Math.round((fourth+increment)*10000.0)/10000.0;
//System.out.println("zero:"+zero+" first:"+low+" second:"+second+"
third:"+third+" fourth:"+fourth+" fifth:"+fifth);
g.drawString("($)",0,225);
g.drawLine(50,40,50,350);
g.drawString(Double.toString(low),10,300);
g.drawString(Double.toString(second),10,250);
g.drawString(Double.toString(third),10,200);
g.drawString(Double.toString(fourth),10,150);
g.drawString(Double.toString(fifth),10,100);
}
Now i need help devising a formula for a seperate function in which it
takes the value from the db and converts it to coordinates ont ehs cale
in the right spot.
I hope i made sense
Any suggestions are greatly appreciated.
Thanks in adavance
-morc