我可以使用 Flex 3.5 将数组值(不是数组集合值)传递到条形图或柱形图吗?

发布于 2024-09-18 06:36:29 字数 489 浏览 22 评论 0原文

无论如何,我可以使用 Flex 3.5 将数组值(不是数组集合值)传递到条形图或柱形图吗?

我需要的是:我有这样的数组值,

 array1 = [23, 49, 40, 239, 20, 80, 39,49,120, 24, 31,41];

我想在 Y 轴上显示这些值,在 X 轴上显示月份。


我有两个问题:

  1. 如何将此数组传递给条形图或柱形图?

  2. 我如何需要在 X 轴上显示月份?我保留了一个过滤器,即使我们想查看某些月份或特定月份或特定月份范围。在 X 轴上,它需要根据过滤器动态更改月份。例如,如果我选择 3 个月期间过滤器,则 X 轴上的值应为 [Jan、Apr、Jun、Oct]

我已编写一个逻辑来将这些特定月份的值收集到数组中,但我不明白如何将此数组传递给条形图,因为我不知道要给出什么 X 字段和 Y 字段。

Is there anyway where I can pass the Array values (not the array collection values) to the Bar charts or column charts using Flex 3.5?

Here what I need: I have array values like this,

 array1 = [23, 49, 40, 239, 20, 80, 39,49,120, 24, 31,41];

and I want to show these values on the Y-axis and months on X-axis.


I have two questions:

  1. How can I pass this array to Bar chart or column chart?

  2. How do I need to show months on X-axis? I have kept a filters that even if we want to see some months or a particular months or particular span of months. On X-axis it need to change the months dynamically depending on the filters. For example on X-axis the values should be [Jan, Apr, Jun, Oct] if I select the 3 months period filter

I have written a logic to collect the values of those particular months into an array, but I don't understand how to pass this array to Bar chart, because there I don't know what X-field and Y-field to be given.

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

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

发布评论

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

评论(1

往事风中埋 2024-09-25 06:36:29

1) 如何将此数组传递给 Bar
图表或柱形图。

图表的 dataProvider 属性是一个对象。所以你可以在那里发送任何你想要的东西。我希望它能够像处理 ArrayCollection 一样处理数组。

也就是说,我相信您将必须发送具有表示 xField 和 yField 值的数据属性的对象。简单值数组无法为组件提供足够的信息来了解该做什么。

2) 我需要如何显示月份
X 轴。因为我问这个
关于,我保留了一个过滤器
即使我们想看到几个月或
特定月份或特定跨度
几个月...Xaxis 上需要
动态更改月份
取决于过滤器......(例如,
X 轴上的值应为 (Jan,
四月、六月、十月)如果我选择 3 个月
周期过滤器......)

我相信,如果您创建对象,正如我之前所说,Xfield 值是代表月份的字符串,ay 字段值代表您的数据点,图表应该知道如何显示这些值。

如果您使用的是 ArrayCollection,您可以轻松地使用集合的过滤功能来更改 dataProvider,我希望这会更改图表。

有关此内容的更多文档

1) how can I pass this array to Bar
chart or column chart.

The dataProvider property of the charts is an object. So you can send anything you want in there. I would expect it to handle an array just as well as it would handle an ArrayCollection.

That said, I believe you're going to have to send in objects with data properties that represent the xField and yField values. An array of simple values doesn't give the component enough information to know what to do.

2) how do I need to show months on
Xaxis. beacuse I'm asking this
regarding, I have kept a filters that
even if we want to see some months or
a particular months or perticalar span
of months... there on Xaxis it need to
change the months dynamically
depending on the filters..... (for ex,
on Xaxis the values should be (Jan,
Apr, Jun,Oct) if i select the 3 months
period filter....)

I believe if you create objects, as I stated before with the Xfield value being a string representing the month and a y field value representing your data point, the graph should know how to display the values.

If you were using an ArrayCollection you could easily use the collection's filtering abilities to change the dataProvider, which I would expect would change the graph.

More docs on this

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