This example adds a popup menu to the dashboard item caption. This menu allows users to switch between Chart items with different settings.
The Dashboard control does not allow you to customize a Chart item and change its settings at runtime. As a possible solution, you can create a tab container, add different Chart items to tab pages, and configure the group interval for each Chart. To allow users to switch between Chart items at runtime, handle the ViewerApiExtensionOptions.onItemCaptionToolbarUpdated event and add a button with the popup menu to the dashboard item caption. Call the ViewerApiExtension.setSelectedTabPage or ViewerApiExtension.setSelectedTabPageIndex function to switch between the tab pages when a user clicks the menu elements.
You can also modify the dashboard XML definition to hide the tab container’s caption. Add the ShowCaption
attribute to the TabContainer
element and set its value to false
:
<TabContainer ComponentName="tabContainerDashboardItem1" Name="Tab Container 1" ShowCaption="false">
<Pages>
(you will be redirected to DevExpress.com to submit your response)