Excel图表,y轴为米,中y轴为英尺。

时间:2022-12-04 10:02:45

I have simple Excel chart, numerical values by date.

我有简单的Excel表格,按日期计算数值。

The x axis is the date.

x轴是日期。

The y axis shows numerical values in meters.

y轴表示以米为单位的数值。

I want to show the equivalent numerical values in feet on a secondary y axis.

我想在y轴上用英尺表示等价的数值。

Is the only option to create two series, one for meters and a second for feet , and then plot both on chart, and modify axis ranges so they overlap?

唯一的选择是创建两个系列,一个是米系列,另一个是英尺系列,然后在图表上绘制它们,并修改轴的范围以便它们重叠吗?

Is there some option in Excel chart I haven't found that allows secondary y axis to display the y axis values in another unit, perhaps by putting in conversion formula eg feet = meters / .3048 ?

在Excel表格中是否有一些选项,我还没有发现,在另一个单元中,可以通过输入转换公式,例如英尺=米/。3048来显示y轴值。

1 个解决方案

#1


1  

In order to show a secondary axis you need to plot a series on the secondary axis. If you want the secondary axis to show a different unit of measure, then, yes, the only option is to plot a data series on that axis. It does not have to contain all the values of the series on the primary Y axis. In fact, just one data point will be sufficient.

为了显示第二轴,你需要在第二轴上绘制一个级数。如果您希望次要轴显示不同的度量单位,那么,是的,惟一的选择是在该轴上绘制数据序列。它不需要包含在主Y轴上的系列的所有值。事实上,只有一个数据点就足够了。

The challenge is to keep the axes aligned so the series as plotted shows the correct data points for both axes.

挑战在于保持坐标轴对齐,以便绘制的级数显示两个坐标轴的正确数据点。

Excel will calculate the minimum and maximum values for a chart's Y axis and it will strive to create round numbers for that. If the metric maximum value is, for example, 100 metres, then the equivalent maximum for the imperial axis needs to be 328.084 and that is not something that Excel will default to.

Excel将计算图表Y轴的最小值和最大值,并努力为此创建整数。如果度量值的最大值是100米,那么帝国轴的等效最大值需要是328.084,这不是Excel默认的值。

You would need to inspect the maximum value of the primary Y axis, convert it to the desired unit and manually set the maximum value of the secondary Y axis to that number. This process can be automated with VBA.

您需要检查主Y轴的最大值,将其转换为所需的单位,并手动将辅助Y轴的最大值设置为该数字。这个过程可以通过VBA实现自动化。

#1


1  

In order to show a secondary axis you need to plot a series on the secondary axis. If you want the secondary axis to show a different unit of measure, then, yes, the only option is to plot a data series on that axis. It does not have to contain all the values of the series on the primary Y axis. In fact, just one data point will be sufficient.

为了显示第二轴,你需要在第二轴上绘制一个级数。如果您希望次要轴显示不同的度量单位,那么,是的,惟一的选择是在该轴上绘制数据序列。它不需要包含在主Y轴上的系列的所有值。事实上,只有一个数据点就足够了。

The challenge is to keep the axes aligned so the series as plotted shows the correct data points for both axes.

挑战在于保持坐标轴对齐,以便绘制的级数显示两个坐标轴的正确数据点。

Excel will calculate the minimum and maximum values for a chart's Y axis and it will strive to create round numbers for that. If the metric maximum value is, for example, 100 metres, then the equivalent maximum for the imperial axis needs to be 328.084 and that is not something that Excel will default to.

Excel将计算图表Y轴的最小值和最大值,并努力为此创建整数。如果度量值的最大值是100米,那么帝国轴的等效最大值需要是328.084,这不是Excel默认的值。

You would need to inspect the maximum value of the primary Y axis, convert it to the desired unit and manually set the maximum value of the secondary Y axis to that number. This process can be automated with VBA.

您需要检查主Y轴的最大值,将其转换为所需的单位,并手动将辅助Y轴的最大值设置为该数字。这个过程可以通过VBA实现自动化。