I am calling this draw() function when i click on submit button from html page
The problem is when i click on submit button , js error is displaying that...... at line 23 shown in comments... that "Object doesnot support this property or method"
This is my Javascript MyScript.js
function draw()
{
document.getElementById('svgdoc').innerHTML = '<embed id = "emb_svg" name="barChart" height="400" src="Trial.svg" width="400" >';
value1 = 50;
value2 = 75;
var x1 = 98;
var x2 = 166;
var barWidth = 10;
var lineBottom = 270;
var lineLeftmargin = 30;
var maxBarTop = lineBottom - lineLeftmargin
var maxInputValue = 100;
var width1 = 35;
var width2 = 35;
var height1 = ((value1 * maxBarTop) / maxInputValue);
var y1 = lineBottom - height1;
var height2 = ((value2 * maxBarTop) / maxInputValue);
var y2 = lineBottom - height2;
var dupsvg=document.barChart.getSVGDocument();
/* line23 */ dupsvg.getElementById("Bar1").setAttribute("x",x1) ;
dupsvg.getElementById("Bar1").setAttribute("y",y1) ;
dupsvg.getElementById("Bar1").setAttribute("width" ,width1);
dupsvg.getElementById("Bar1").setAttribute("height ",height1);
dupsvg.getElementById("Bar2").setAttribute("x",x2) ;
dupsvg.getElementById("Bar2").setAttribute("y",y2) ;
dupsvg.getElementById("Bar2").setAttribute("width" ,width2);
dupsvg.getElementById("Bar2").setAttribute("height ",height2);
}
Help me ...............
Thanks
Kavitha