0

markers道場チャートに表示されているポインタをアニメーションで動かすことはできますか?

助けてください。

4

1 に答える 1

1

解決策の1つは、このようなものかもしれません。

//以下はマーカーの簡単なアニメーションです

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);

        }
于 2011-05-30T14:31:40.040 に答える