在 JasperReports 条形图中处理大数据

发布于 2025-01-04 03:42:38 字数 245 浏览 3 评论 0原文

我正在使用JasperReports 4.0.1 我有大量的数据集要在分组条形图中表示,

条形图挤满了并且渲染得彼此非常接近。

Jasper Report 大数据水平条形图

有什么方法可以正确缩放它吗?

或者给出记录数量限制,之后 JasperReports 可以将其拆分为多个图表?

I'm using JasperReports 4.0.1
I am having large data set to be represented in Grouped Bar Graph

The bar are crammed and rendered very close to each other.

Jasper Report Horizontal Bar Graph with large data

Is there any way to scale it properly?

Or to give record number limit , after which JasperReports can split it in multiple graphs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半衾梦 2025-01-11 03:42:38

图表定制器当然可以让您完全控制做任何您喜欢的事情。但在这种情况下,您也许仍然可以在没有图表定制器的情况下做一些有趣的事情。

我不确定你所说的“适当缩放”是什么意思,所以我无法对此部分发表评论。

您可以向报告添加一个组,以防止图表包含太多值。例如,您可以对这样的表达式进行分组:

new Integer($V{REPORT_COUNT}/10)

这样,每组中将仅获得 10 个项目。将图表放入组页脚中。如果行数少于 10 行,您将得到一个图表。如果您有更多行,那么您将获得多个图表。

您的分组可能比仅仅计算行数更复杂,但应该应用相同的想法。

Chart customizers certainly give you full control to do whatever you like. But you could perhaps still do some interesting things without a chart customizer in this case.

I'm not sure what you mean by "scale it properly", so I can't comment on that part.

You could add a group to the report to prevent the chart from having too many values. For example you could group on an expression like this:

new Integer($V{REPORT_COUNT}/10)

That way you would get only 10 items in each group. Put the chart into the group footer. In the case where you have fewer than 10 rows you'll get a single chart. If you have more rows, then you'll get multiple charts.

Your grouping would probably be more complex than just counting the rows, but the same idea should apply.

欢你一世 2025-01-11 03:42:38

像 jasper-reports 中那样自定义图表的唯一方法是实现您自己的图表自定义程序类。这是我找到的一篇文章链接

The only way to do customize charts like that in jasper-reports is to implement your own chart customizer class. Here is an article I found link

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文