N,11));
g.drawString(Float.toString(pcent),x0,y0-5);//在柱状图上绘制%
if(I%2==0)
g.setColor(Color.orange);
else
g.setColor(Color.red);
g.fillRect(x0,y0,hx,hy); //绘制柱状图
//g.setColor(Color.red); //绘制股票代码
//g.setFont(new Font("Times New Roman",Font.PLAIN,10));
//g.drawString(""+xCode[I],x0,height-topMargine+40);
}
Color titleColor=new Color(0,64,128);
g.setColor(titleColor);
g.setFont(new Font("monospaced",Font.BOLD,20));
g.drawString(title,190,40);
}
catch(Exception e){
System.out.println("sellhis paint error.");
System.out.println(e);
}
}
public static float Substr(String str){
int I=0;
StringTokenizer st = new StringTokenizer(str,",");
int len=st.countTokens();
float val=new float[len];
while(st.hasMoreTokens()) {
val[I]=Integer.parseInt(st.nextToken());
I++;
}
return val;
}
public static String Subicode(String str){
int I=0;
StringTokenizer st = new StringTokenizer(str,",");
int len=st.countTokens();
String val=new String[len];
while(st.hasMoreTokens()) {
val[I]=st.nextToken();
I++;
}
return val;
}
public static String getMaxVal(float Maxval){
int I;
float result;
result=Maxval[0];
for(I=0;I<Maxval.length;I++){
if(result<Maxval[I])
result=Maxval[I];
}
return Float.toString(result);
}
public String getTitle(String str){
String title;
title=str.substring(0,4)+"年"+str.substring(4,6)+"月賣空