简体   繁体   English

在flex中单击按钮后如何显示图表?

[英]how to show chart after clicking on button in flex?

I have made menu bar. 我做了菜单栏。 I have taken 4 options on it. 我已经采取了4个选择。 Now when i click on one option from menu bar then i want to show chart. 现在,当我从菜单栏中单击一个选项时,我想显示图表。 How to achieve it? 如何实现呢?

Thanks in Advance-- 提前致谢 -

Since you didn't share code, here is how you do it conceptually: 由于您没有共享代码,因此以下是您在概念上的做法:

  1. Listen for the click event on the menu bar option. 侦听菜单栏选项上的click事件。
  2. Toggle visibility of the chart in the click handler. 在点击处理程序中切换图表的可见性。 This can be done by toggling the visible property from true to false; 这可以通过将visible属性从true切换为false来完成。 or by changing a state. 或更改状态。

You would want to add an event listener to that menu bar to know when you've selected the 'option' that's suppose to show a chart. 您可能想向该菜单栏添加一个事件侦听器,以了解何时选择了假设要显示图表的“选项”。 When that handler is triggered, add that view to your display list (the one with the chart). 触发该处理程序后,将该视图添加到您的显示列表中(带有图表的视图)。

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

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