如何在 Access 表单中重新绘制 Microsoft Chart
我有一个子表单,它在其父表单中设置Microsoft Chart 5.0对象的RowSource。
编辑:图表的行源类型是值列表。
然而,该图形不会自行绘制,但任何通常会生成重绘的操作(将另一个 Access 窗口拖到其上、将其最小化、有时会丢失和重新获得焦点)确实会重绘它。换句话说,图表不会自动显示或更改。
如何在子表单操作后强制重新绘制图表?
这些没有效果:
parent.Referesh
parent.Repaint
parent.TheChart.Refresh
不幸的是,这似乎不存在:
parent.TheChart.Repaint
使用:Access 2003
I have a subform which sets the RowSource of a Microsoft Chart 5.0 object in its parent form.
EDIT: The Row Source Type for the graph is Value List.
The graph does not paint itself, however, but any action which would generally generate a repaint (drag another Access window over it, minimize it, loss and regain of focus sometimes) does indeed repaint it. In other words, the graph doesn't show or change automatically.
How do I force a repaint of the chart after a subform action?
These have had no effect:
parent.Referesh
parent.Repaint
parent.TheChart.Refresh
And this does not seem to exist, unfortunately:
parent.TheChart.Repaint
Using: Access 2003
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题不在于重新绘制图表。最有可能的是,您正在使用的子表单正在从查询或表中检索数据。
您必须更新“数据源”对象上的值,该对象提供子表单数据(查询或表)。然后,在主窗体中重新查询图形对象。
我在 MS-Acess 2000 中做了一个非常简单的示例,效果非常好:
frt_id
、frt_name
)的表(t01_fruits
) ,frt_qty
)。t01_fruits
的饼图和一个按钮。在按钮的OnClick
事件中,我只放置了me.graph1.requery
。当我更新主窗体内子窗体中的水果数量时,图表没有任何反应。当我单击该按钮时,图表会正确更新。
The problem isn't the repainting of the graph. Most likely, the subform that you are using is retrieving data from a query or table.
You must update the values on the "datasource" object, which is providing the subform data (either a query or a table). Then, re-query the graph object in the mainform.
I made a very simple example in my MS-Acess 2000 and it worked great:
t01_fruits
) with three columns (frt_id
,frt_name
,frt_qty
).t01_fruits
and a button. In theOnClick
event of the button, I put justme.graph1.requery
.When I update the fruits quantity in subform, inside mainform, nothing happens with the graph. When I click the button, the graph is updated correctly.
更新表单信息后刷新图表时我也遇到了同样的问题。我通过在更新链接到数据更改的收件箱后重新查询图表来解决这个问题。
我是持有图表的表格......
I also faced same problem in refreshing chart after updating information in form. I got it resolved by re-queering the chart after update of the inbox linking to change of data.
Me is the Form holding graph....
我遇到了类似的问题,主页带有子表单,包括 2 个带有图形的页面 - 刷新它的解决方案如下:
只有当您按此顺序执行命令时,它才会正确更新图形。
我知道自提出问题以来已经有一段时间了,但以防万一其他人也遇到这样的问题。
I had similar problem like this, having main page with sub-forms, including 2 with graphs - and solution to refresh it was like this:
Only when you execute commands in this order, it would update graph properly.
I know it's been a while since question was asked, but in case anyone else has issue like this.