こんにちは!今D3.jsで簡単なグラフを作ってみていますが
SVGタグのattributeのValueが必要なのでJavascriptでSVGタグに接近したところ、
NULLがリターナブルされました。
もしかするとSVGタグに接近する時、特別なselectorがあるのですか?
ご意見待っています。
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>secessionCustomer</title> <style> .liquidFillGaugeText { font-family: Helvetica; font-weight: bold; } </style> <script src="../d3-master/d3.min.js" language="JavaScript"></script> <script src="liquidFillGauge.js" language="JavaScript"></script> <script src="https://code.jquery.com/jquery-latest.js" language="JavaScript"></script> <script language="JavaScript">var targetTagId = document.getElementById('fillgauge');
console.log(targetTagId);
<body> <header> </header> <section> <div id="main" wdith="50%"> <div id="liquidArea" wdith="40%" > <svg id="fillgauge" width="50%" height="50%" onclick="gauge.update(NewValue());"></svg> </div> </div> </section> <footer> </footer> </body> </html>var config = liquidFillGaugeDefaultSettings(); config.circleColor = "#FF7777"; config.textColor = "#FF4848"; config.waveTextColor = "#FF0000"; config.waveColor = "#FFDDDD"; config.circleThickness = 0.2; config.textVertPosition = 0.2; config.waveAnimateTime = 1000; var gauge= loadLiquidFillGauge("fillgauge", 25, config); function NewValue(){ if(Math.random() > .5){ return Math.round(Math.random()*100); } else { return (Math.random()*100).toFixed(1); } } </script> </head>
回答2件
あなたの回答
tips
プレビュー