BarChart文本截断问题 [英] BarChart text truncation problems

查看:57
本文介绍了BarChart文本截断问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题,可以通过以下屏幕截图来说明:

I have two problem, which can be illustrated by these screenshots:

那么,在这种情况下如何避免文本被截断?当然,宽度就足够了.此外,截断对于不同的字符串也有所不同.

So, how to avoid text's truncation in these case ? Of course, the width is enough.Moreover, truncation differs for differen strings.

推荐答案

我怀疑首选尺寸问题.您可以覆盖 ChartPanel 中的 getPreferredSize()以获得漂亮的初始显示,如此处,并指定 BorderLayout.CENTER GridLayout 之类的布局,以使面板采用封闭的 Container 的大小.失败的话,请编辑您的问题,以包含显示您遇到的任何问题的 sscce .

I suspect a layout or preferred size problem. You can override getPreferredSize() in ChartPanel to get a nice initial display, as shown here, and specify a layout like BorderLayout.CENTER or GridLayout to let the panel adopt the size of the enclosing Container. Failing this, please edit your question to include an sscce that exhibits any problem you encounter.

这篇关于BarChart文本截断问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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