我一直在尋找一個例子有日誌的規模,我發現這裏的東西:的JavaFX 1.x中,以JavaFX2圖對數
http://blog.dooapp.com/javafx-chart-api-and-logarithmic-scale-tag-ja
這裏:
https://forums.oracle.com/forums/thread.jspa?threadID=2420118&stqc=true
但它是用JavaScript編寫的:有沒有人在JavaFX 2.x中重寫這兩種方法?
var logUpperBound: Number = bind Math.log10(upperBound);
var logLowerBound: Number = bind Math.log10(lowerBound);
override public function getDisplayPosition(arg0: Object): Number {
def delta = logUpperBound - logLowerBound;
def deltaV = Math.log10((arg0 as Number)) - logLowerBound;
if (orientationVertical) {
return (1 -((deltaV)/delta)) * height;
} else {
return ((deltaV)/delta) * width;
}
}
override protected function updateTickMarks(): Void {
if (tickMarks.size() == 0) {
for (i in [0..Math.log10(upperBound)-1], j in [1..9]) {
var v = j * Math.pow(10, i);
insert CustomTickMark {
customLabel: "{%6.0f v}"
customPosition: getDisplayPosition(v)
customValue: v
} into tickMarks;
}
}
}
我不能使用這些方法,因爲我不知道的JavaScript。
僅供參考,這是JavaFX的1.x的腳本不是JavaScript的。你可能想更新你的問題。 – jewelsea 2012-07-27 11:22:43