使用宏在 Excel 图表中创建水平线
在工作中,我制作了一个宏来格式化和绘制来自测试我们制造的零件的数据。这些值必须在一定范围内,因此我想在图表中添加线条来指示公差限制的位置。
例如,一个参数是某一信号的电压值。它必须在 0.271 和 0.451 之间才能符合规格,因此我想在该图表上的这些值处添加线条。
其他图表测量不同的事物并且具有不同的值,但基本原理是相同的。
每个信号的数据点数量并不相同,但通常都很大,每个信号大约有几千个。
我在互联网上找到了几个不同的选项,涉及绘图工具或向图表添加新的数据系列,但我不太熟悉 Excel 宏的这些方面。事实上,我认为我找不到第一次找到数据系列想法的页面。
At work, I have made a macro to format and chart out data that comes from testing the parts we make. The values have to be within a certain range, so I would like to add lines to the charts denoting where the tolerance limits are.
For example, one parameter is a voltage value for a certain signal. It must be between .271 and .451 to be in spec, so I would like to add lines at those values on that chart.
Other charts are measuring different things and would have different values, but the basic principle is the same.
The number of data points per signal is not the same, but is usually quite large, around a couple thousand each.
I have found a couple of different options around the internet involving the drawing tools or adding a new data series to the charts, but I am not well versed in those aspects of excel macros. In fact, I don't think I can find the page that I first found the data series idea at.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
每条线推出一个新系列是最好的方法。
用法(为每个截止点添加一行):
A new series for each line is the best approach.
Usage (adding one line for each cut-off):
假设您使用的是 XY 散点图,只需创建几个数据点并将其添加为新系列。例如,输入 A1:B6 中所示的数据,然后将整个范围添加为一个系列。你会得到两条线。显然,X 和 Y 值应该根据原始数据计算得出。
Assuming you are using an XY Scatter chart, just create a couple of data points and add it as a new series. For example, enter your data as shown in A1:B6 and then add that entire range as a series. You'll get two lines. Obviously, the X and Y values should be calculated from your original data.