2006年 08月 03日

PlotKit

pie の場合だと label に要素を使えないっぽい。バグ?

"xTicks" : [
    {v:0, label:A({href:""}, "foobar")}
]

bar ではうまくいく。pie だとなんか文字列変換される。

Layout.js

label += " (" + formatter(slice.fraction) + ")";

これのせいで、文字列に変換されてる。さてどうするかな span でくくって付け足すが妥当か。

$ diff -u Layout.js.old Layout.js
--- Layout.js.old       2006-06-05 03:50:02.000000000 +0900
+++ Layout.js   2006-08-03 17:42:07.000000000 +0900
@@ -617,7 +617,7 @@
             if (slice) {
                 if (isNil(label))
                     label = tick.v.toString();
-                label += " (" + formatter(slice.fraction) + ")";
+                label = SPAN(null, label, " (" + formatter(slice.fraction) + ")");
                 this.xticks.push([tick.v, label]);
             }
         }

こんなんにした。