问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/15863515/barchart-text-truncation-problems