We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Context menu on point series

Thread ID:

Created:

Updated:

Platform:

Replies:

145621 Jul 1,2019 03:10 PM UTC Jul 2,2019 12:20 PM UTC JavaScript - EJ 2 1
loading
Tags: Chart
Alex Siler
Asked On July 1, 2019 03:10 PM UTC

Is it possible to open a context menu at the point of the clicked series?
regards

Kalaimathi Chellaiah [Syncfusion]
Replied On July 2, 2019 12:20 PM UTC

Hi Alex, 
 
Greetings from Syncfusion. 
 
We have analyzed your query. We can achieve your requirement using pointClick event of the chart. This event fired when we click the series point. So we have created a context menu inside of this event and set menu item target as chart container ID. Now the context menu is working fine as you expect.  We have prepared a simple sample based on your requirement. Please find below sample and code snippet, 
 
Code Snippet: 
let menuObj: ContextMenu; 
 
let menuItems: MenuItemModel[] = [ 
  { 
    text: 'Cut', 
    iconCss: 'e-cm-icons e-cut' 
  }, 
  { 
    text: 'Copy', 
    iconCss: 'e-cm-icons e-copy' 
  }, 
  { 
    text: 'Paste', 
    iconCss: 'e-cm-icons e-paste' 
  }]; 
 
//ContextMenu model definition  
let menuOptions: ContextMenuModel = { 
  target: '#container_svg', 
  items: menuItems, 
}; 
 
// To create context menu when click the point 
pointClick: (args: IPointEventArgs) => { 
    if(menuObj && !menuObj.isDestroyed) { 
      menuObj.destroy(); 
    } 
    menuObj = new ContextMenu(menuOptions, '#contextmenu'); 
  } 
 
Screenshot: 
 
 
 
 
Hope this helps. 
 
Regards, 
Kalai. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon