javascript - SAPui5 sap.viz.ui5.StackedColumn custom tooltip on data point -
i trying implement custom tooltip in sap viz stacked column chart. little popup window appears when mouse hovers datapoint. problem how observe position of info point tooltip popup points it. points graph itself, not datapoint within graph. here's have:
graph = new sap.viz.ui5.stackedcolumn({ width: graphwidth, height : graphheight, //.. more properties here interaction: new sap.viz.ui5.types.controller.interaction({ decorations: [{name: "showdetail", fn: showdetailhandler}, {name: "hidedetail", fn:hidedetailhandler}] }),
and showdetailhandler this. supposed display popup pointing info point.
var showdetailhandler = function(oevent){ var info = oevent.data; var offset = '0 0'; var tp3 = new sap.ui.ux3.toolpopup({ content : [ new sap.ui.commons.button({ text : "button" }) ], }); offset = '0 0'; offset = oevent.position.x + " " + oevent.position.y; tp3.setposition( sap.ui.core.popup.dock.centerbottom, sap.ui.core.popup.dock.centertop, $(oevent.container), offset, "none"); if (tp3.isopen()) { tp3.close(); } else { tp3.open(sap.ui.core.popup.dock.centerbottom, sap.ui.core.popup.dock.centertop); } };
the docs around here: https://sapui5.hana.ondemand.com/sdk/#docs/api/symbols/sap.ui.core.popup.html#setposition https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.viz.ui5.types.controller.interaction.html#getdecorations
my understanding offset offset point calculated anchor point. problem is, offset ignored. popup appears @ top of graph.
however, normal tooltip appears in right place.
any idea/example?
thank in advance.
javascript sapui5
No comments:
Post a Comment