3

次のような棒グラフの凡例を作成したいと思います。

 |  |  |  |
/  /  /  /

どこで | : データ列、/ : 各列の凡例

テキストの凡例を正しく取得できませんでした。複数の maxtrix 変換を試してみましたが、どれも正しく機能しませんでした。

for (int col = 0; col < 4; col++) {
                       // Draw emotions legends
                applet.fill(100);
                applet.textFont(font, 20);

                // perform matrix transform
                applet.rotate(-0.75f);
                applet.translate(col * columnW, h);

                // draw text
                applet.text(legends[col], 0, 0);

                // undo matrix
                applet.translate(-col * columnW, -h);
                applet.rotate(0.75f);
}

助けてください :(

4

1 に答える 1

1

答えを知りたい方へ:

for (int col = 0; col < 4; col++) {
                applet.pushMatrix();
                applet.translate(col * blockW, h);
                // Rotate the text
                applet.rotate(-0.75f);

                // Display the text
                applet.text(Emotion.values()[col].toString(), 0, 0);
                applet.popMatrix();
}
于 2015-03-24T12:51:39.410 に答える