1

我正在将图表创建为 Access 表单,但我不知道如何在同一个图表上显示两个数据字段。我有一个数据表(嗯,真的是一个查询):

tran_type | avg_cycle_time | count_of_cycle_time
A         | 26             | 1
B         | 31.5           | 2
C         | 42.56          | 25

现在我有一个条形图avg_cycle_time by tran_type(所以横轴上的 A、B、C,然后是三个显示 26、31.5 和 42.56 值的条形图)。

理想情况下,我想做的是显示该栏中的值的计数,尽管我认为这可能会很棘手,所以我会选择折线图或其他东西来显示计数(对于这种情况,我认为这很重要当用户看到一个平均值时,他/她也会看到有多少数据点进入该平均值)。

我知道根据数据,这可能意味着在垂直轴上有两个刻度,但我不确定这是否有问题或是否受支持。我觉得我已经在 Excel 中看到过这种类型的事情,也许 Access 图表没有那么健壮,但不幸的是该应用程序在 Access 中,所以希望有一个解决方案。如果需要,我可以使用 VBA。

4

1 回答 1

0

After some playing around, this was actually easier than I was making it. When setting up the graph using the wizard, drag both fields (in this case avg_cycle_time and count_of_cycle_time) to the vertical axis. If a bar chart is selected, this will create two bars side by side for each tran_type. What I learned though is you can right click on one set of bars (in Design mode) and select Chart Type, and that will alter the type for just that data series. So I changed the second set of bars to a line.

If you then want to have a second set of axis values (say if one field was a number and the other was a percentage, or the values in each set are out of whack), you can right click on the series and select Format Data Series, and on the Axis tab choose Secondary axis. You can also show the value of that series--on the Data Labels tab select to show values. This got me what I was looking for in showing the number of data points for each bar (even though the actual value is associated with the line, it's still what I was hoping to represent).

于 2012-06-06T16:19:59.420 回答