在pieChart图例中对齐文本 - 如何右对齐图例内的内容 [英] Aligning text in pieChart legend - How to right align the content inside the legend

查看:284
本文介绍了在pieChart图例中对齐文本 - 如何右对齐图例内的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截至目前,我的传奇显示如下



test1 5%

test2test2 10%


test2test2test3 85%


¥b $ b我试图这样显示,空格和右对齐。



test1 ------------------------- 5%

test2test2test2 ----------- 10%

test3test3test3 ----------- 85%

As of now my legend is displayed like this

test1 5%
test2test2 10%
test2test2test3 85%


I am trying to display like this, with spaces and right aligned.

test1-------------------------5%
test2test2test2-----------10%
test3test3test3-----------85%

任何建议赞赏

推荐答案

您可以使用显示的方法此处创建一个包含图例项目的单独面板。给面板一个 GridLayout(0,1);为左列指定 JLabel.LEFT ,为右列指定 JLabel.RIGHT 此处显示了一个完整的示例。

You can use the approach shown here to create a separate panel containing your legend items. Give the panel a GridLayout(0, 1); specify JLabel.LEFT for the left column and JLabel.RIGHT for the right column. A complete example is shown here.

图片http://i46.tinypic.com/30273pc.png

这篇关于在pieChart图例中对齐文本 - 如何右对齐图例内的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆