dojox.gfx

Remove all the children DOM elements in div

你说的曾经没有我的故事 提交于 2019-12-28 02:28:07
问题 I have the following dojo codes to create a surface graphics element under a div: .... <script type=text/javascript> .... function drawRec(){ var node = dojo.byId("surface"); // remove all the children graphics var surface = dojox.gfx.createSurface(node, 600, 600); surface.createLine({ x1 : 0, y1 : 0, x2 : 600, y2 : 600 }).setStroke("black"); } .... </script> .... <body> <div id="surface"></div> .... drawRec() will draw a rectangle graphics first time. If I call this function again in an

add text to dojo chart (in this case scatter chart)

爱⌒轻易说出口 提交于 2019-12-11 03:06:54
问题 I want to add custom text to my (scatter) chart. I could netiher find an example nor any other appropriate dojo function for that. By now I have a tooltip for each point of my scatter chart, but I'd rather like to have a label for it. Any idea? Thanks! 回答1: You need to upgrade to dojo 1.9.7 at least to use this answer: First of all, You have to set a new option: "labelStyle: 'outside'". This position the text uppon the circle in case the label width is larger than than the circle. The next

export/convert chart from dojo charting to image

邮差的信 提交于 2019-11-30 18:06:21
问题 can anyone tell me if it is possible to convert a dojo charting object into an îmage file? I need this as I want to export an Excel file from a webpage containing some data and the representing chart. The only thing I found is http://dojotoolkit.org/reference-guide/dojox/gfx/utils/toSvg.html#dojox-gfx-utils-tosvg but I do not really know how to proceed with the output of that function. Thanks you! 回答1: What you found will work as long as you know what to do with SVG (e.g., rasterize it using

Remove all the children DOM elements in div

冷暖自知 提交于 2019-11-27 03:14:30
I have the following dojo codes to create a surface graphics element under a div: .... <script type=text/javascript> .... function drawRec(){ var node = dojo.byId("surface"); // remove all the children graphics var surface = dojox.gfx.createSurface(node, 600, 600); surface.createLine({ x1 : 0, y1 : 0, x2 : 600, y2 : 600 }).setStroke("black"); } .... </script> .... <body> <div id="surface"></div> .... drawRec() will draw a rectangle graphics first time. If I call this function again in an anchor href like this: <a href="javascript:drawRec();">...</a> it will draw another graphics again. What I