堆积面积图,固定y轴标签宽度 [英] Stacked Area Chart, fixed y axis label width

查看:545
本文介绍了堆积面积图,固定y轴标签宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个JFreeChart堆叠区域图表。

I am creating a JFreeChart stacked area chart.

我想要修改 y 轴标签的宽度,想要随着宽度的增加而移动图表。请参阅解释问题的图片。

I want my y axis label's width to be fixed, and I don't want to shift the chart as the width increases. See the image explaining the problem.

我面临类似的问题,发布在 JFreeChart论坛。根据论坛是固定的,但它还没有发布。任何机构都知道它的修复。我们不能等待下一个版本,是否有任何机构知道我们可以应用的黑客?

I am facing similar problem as posted on the JFreeChart forum. As per the forum it is fixed, but it is not yet released. Does any body knows its fix. We can't wait for next release, does any body knows a hack which we can apply?

希望有一些解决方案。

推荐答案

一个可能的解决方案是覆盖图表的rangeaxis的findMaximumTickLabelWidth()。最大宽度可以硬编码为特定值,也可以视为最大宽度和计算出的最大宽度的最大值。

A possible solution is to override the findMaximumTickLabelWidth() for rangeaxis of the chart. The maximum width can be hardcoded to a specific value or can be taken as max value of maximum width and calculated maximum width.

这篇关于堆积面积图,固定y轴标签宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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