我想为条形图创建一个图例,如下所示:
| | | |
/ / / /
在哪里 | :数据列,/:是每列的图例
我无法正确获取文本图例,尝试多个 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);
}
请帮忙 :(