Dojo 制图标记问题

发布于 2024-11-10 03:17:19 字数 60 浏览 8 评论 0原文

是否可以用动画移动道场图表中显示的markers指针?

请帮忙。

Is it possible to move markers pointer displayed in dojo chart with animation?

please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我早已燃尽 2024-11-17 03:17:19

解决方案之一可能是这样的。

//下面是标记的简单动画,

chart1.connectToPlot("default", function (e){
var ele = e.shape ? e.shape.rawNode ? e.shape.rawNode : false  : false;
    if(!ele) return;
if(e.type == "onmouseover")
ele.setAttribute("stroke-width", 3)
else if (e.type == "onmouseout")
ele.setAttribute("stroke-width", 1.5)
}

您可以使用此函数对原始 svg 节点进行一些复杂的动画。不要在上面的代码中调用 setAttrbuite,而是调用下面的函数将原始 svg 节点传递给它。

function cmplxAnimForRawNode(RawSVGNode){
        var svgNS = "http://www.w3.org/2000/svg";       
        var node = document.createElementNS(svgNS, "animateTransform");
        var atts = {attributeType:"XML", attributeName:"transform", type:"scale" ,from:"1" ,to:"0" ,dur:"5s", fill:"freeze"}
        for(name in atts) {
            node.setAttributeNS(null, name, atts[name]);
        }
        RawSVGNode.appendChild(node);

        }

One of the solution might be like this.

//below is for simple animation for markers

chart1.connectToPlot("default", function (e){
var ele = e.shape ? e.shape.rawNode ? e.shape.rawNode : false  : false;
    if(!ele) return;
if(e.type == "onmouseover")
ele.setAttribute("stroke-width", 3)
else if (e.type == "onmouseout")
ele.setAttribute("stroke-width", 1.5)
}

you can use this function for some complex animation of raw svg node. Instead of calling setAttrbuite in the above code , call the below function passing the raw svg node to it.

function cmplxAnimForRawNode(RawSVGNode){
        var svgNS = "http://www.w3.org/2000/svg";       
        var node = document.createElementNS(svgNS, "animateTransform");
        var atts = {attributeType:"XML", attributeName:"transform", type:"scale" ,from:"1" ,to:"0" ,dur:"5s", fill:"freeze"}
        for(name in atts) {
            node.setAttributeNS(null, name, atts[name]);
        }
        RawSVGNode.appendChild(node);

        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文