简体   繁体   中英

Shield UI JavaScript Export Events

I have a web site where users can view various data using Shield UI JavaScript Chart. I need to be able to provide the Exporting functionality according to the users privileges. I looked at the list of available events

click
load
pointDeselect
pointSelect
seriesClick
seriesMouseOut
seriesMouseOver
seriesVisibilityChange
zoom

and since there isn't any related to pressing the export button, I tried to use the click event:

events: {
    click: function(args) {
        // handle the event
    }
}

However it (obviously) isn't related to clicking on the export button and gets triggered only when clicking on the chart. I will be grateful to any solutions (even just ideas) for solving that problem….

I see two aspects on your problem. The first one is that there are no events related to the export of the chart's graphics. You have figured that out correctly. The other thing is that especially in your case there are plenty of possibilities. For instance you can check your user access level forehand- before displaying the chart and simply set them accordingly.

exportOptions:{
  image: true,
  print: true,
},

If the user doesn't have the right to save the chart information, set the property:

image: false,

Further you may add some information like a message that only certain users have the right to download and so on…

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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