Excel:在图表中添加连接线(必须使用宏)?
因此,我正在 Excel 中处理此图表,该图表看起来像三角形的两侧,如下面链接中的图片所示:
http://a.imageshack.us/img832/6207/triangle.png。
我想制作一条线(例如,使用自动形状)连接两个端点以形成三角形;即从坐标 (4,1) 到 (4,5) 的一条线。我尝试通过在 Excel 中使用连接线的坐标创建一个单独的数据系列来实现此目的,例如:
4,1 4,2 4,3 4,4 4,5
但是,在 Excel 中,该图表中的所有线条必须具有相同的 x 坐标。有谁知道如何自动获取连接线吗?比如说,用宏什么的?我问的原因是因为我希望能够更改这些坐标,并且我希望连接线能够轻松调整(理想情况下,我可以编写一个宏并将其分配给一个按钮,当您单击它时,它会调整连接线)。我的宏观经验非常有限,但这超出了我的能力范围。我使用的图表类型是标准折线图,其中 Excel 给出的描述是“显示随时间或类别变化的趋势”。有人知道好的资源或有一些建议吗?谢谢。
PS我通过将图表类型更改为散点图解决了这个问题,但这弄乱了轴和比例,并且需要对其进行调整,所以我认为以这种方式自动添加一条线会更容易。
So I'm working on this chart in Excel, and the chart looks like two sides of a triange, like the picture at the link below:
http://a.imageshack.us/img832/6207/triangle.png.
I'd like to make a line (like, with an autoshape for example) that connects the 2 endpoints to form a triange; ie a line going from coordinates (4,1) to (4,5). I tried doing this by creating a seperate data series in excel with the coordinates of the connecting line, like:
4,1
4,2
4,3
4,4
4,5
However, in excel, all lines in this chart must have the same x coordinates. Does anyone know how to get a connecting line automatically? Say, with a macro or something? Reason I ask is because I want to be able to change these coordinates, and I want the connecting line to adjust with very little effort (ideally I could write a macro and assign it to a button that when you click it would adjust the connecting line). I have some very limited macro experience, but this is just beyond me. The type of chart I'm using is a standard line chart, where the description given by excel is "Displays trends over time or categories". Anyone know of a good resource or have some advice? Thanks.
PS I solved this problem by changing the chart type to a scatter chart, but this messed up the axes and scale, and required that those be adjusted, so I think adding a line in this manner automatically will be easier.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
散点图工作正常。
使用的公式包含在下图中。
也许您应该添加一张显示您发现的问题的图像。
The scatter chart worked OK.
Used formulas included in the following image.
Perhaps you should include an image showing the problems you found.