@Override
public void setRenderingBySize() {
- // TODO Auto-generated method stub
}
public static String getTooltipContent(int index, double yValue) {
StringBuilder returnString = new StringBuilder();
- return returnString.append(getSeriesNameList().get(index)).append(" : ").append(Formatter.toPercentageFormat(yValue)).toString(); //$NON-NLS-1$
+ return returnString.append(getSeriesNameList().get(index)).append(" : ").append(Formatter.toHzFormat(yValue)).toString(); //$NON-NLS-1$
}
}
return toByteFormat((long)input);
}
+ public static String toHzFormat(long input) {
+ int reminder = 0;
+ long quotient = input;
+ int count = 0;
+ String value = ""; //$NON-NLS-1$
+
+ while (true) {
+ if (quotient >= 1024) {
+ reminder = (int) (quotient % 1024);
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = Long.toString(quotient);
+ String remStr = Integer.toString(reminder);
+ if (count > 0) {
+ if (remStr.length() < 3) {
+ value += ".0"; //$NON-NLS-1$
+ } else {
+ value += "." + remStr.substring(0, 1); //$NON-NLS-1$
+ }
+ }
+ value += " " + getHzMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+ public static String toHzFormat(double input) {
+ return toHzFormat((long)input);
+ }
+
public static String toBpsFormat(long nByte, long startTime, long endTime){
String value = ""; //$NON-NLS-1$
DecimalFormat df1 = new DecimalFormat("#,##0.00"); //$NON-NLS-1$
return "Byte"; //$NON-NLS-1$
}
}
+
+ private static String getHzMeasure(int count) {
+ if (count == 4) {
+ return "THz"; //$NON-NLS-1$
+ } else if (count == 3) {
+ return "GHz"; //$NON-NLS-1$
+ } else if (count == 2) {
+ return "MHz"; //$NON-NLS-1$
+ } else if (count == 1) {
+ return "KHz"; //$NON-NLS-1$
+ } else {
+ return "Hz"; //$NON-NLS-1$
+ }
+ }
}