简体   繁体   English

如何在Excel中制作移动图表?

[英]How to make a moving chart in excel?

I`m designing a program for some project and here is my question: 我正在为某个项目设计程序,这是我的问题:

If I have a set of X , Y and time in excel and I want a chart when I click some button it will move according to the time (more like an animation of the line ) 如果我在excel中有一组X,Y和时间,并且我想要一个图表,当我单击某个按钮时,它将根据时间移动(更像是该行的动画)

I need the name of the function or how to make this happen. 我需要函数的名称或如何实现此目的。 Thank you. 谢谢。

Define the ranges for the chart series using the offset function and include a variable in the row-offset field. 使用偏移函数定义图表系列的范围,并在行偏移字段中包含一个变量。 For example, if you always want to include 10 rows of data that moves, define a series in column A as: 例如,如果您始终要包括10行移动的数据,请在A列中将一系列定义为:

=OFFSET($A$1,Start,0,10,1)

Define another cell as Start and put the value 0 in there. 将另一个单元格定义为“ Start ,然后将值0放入其中。 With each increment of value Start, the range of 10 values will move down by one. 随着值Start的每次增加,10个值的范围将向下移动一。 If you do this for both the x-series an y-series, then used these defined names in the chart, the range of values displayed in the chart will be controlled by the Start value. 如果对x系列和y系列都执行此操作,然后在图表中使用这些定义的名称,则图表中显示的值范围将由“开始”值控制。

Note that when you put named ranges into a chart, they need to be qualified by the sheet name, eg: =Sheet1!XSeries 请注意,当您将命名范围放入图表时,它们需要通过工作表名称进行限定,例如: =Sheet1!XSeries

You can either update Start manually, or link it to a Spin control so that when you click up or down, in increases/decreases the value in the cell by 1. Or you can add commandbuttons with VBA to increase, decrease and reset the value. 您可以手动更新“开始”,也可以将其链接到“旋转”控件,以便在单击上或下时以1的方式增加/减少单元格中的值。也可以使用VBA添加命令按钮以增加,减少和重置值。 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM