I tried to empty a svg and append some it's inner divs back, it doesn't work but can see the html parts are loaded in the browser in faded colour. When i edited it in the browser and add it back it works.
The div part,
<li class="chart">
<svg id="lineChartSVG" class="lineChart--svg">
<defs>
<linearGradient id="lineChart--gradientBackgroundArea" x1="0" x2="0" y1="0" y2="1">
<stop class="lineChart--gradientBackgroundArea--top" offset="0%" />
<stop class="lineChart--gradientBackgroundArea--bottom" offset="100%" />
</linearGradient>
</defs>
</svg>
</li>
this is the way i did,
$('#lineChartSVG').empty();
var html = ' <defs> <linearGradient id=\"lineChart--gradientBackgroundArea\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\"> <stop class=\"lineChart--gradientBackgroundArea--top\" offset=\"0%\" /> <stop class=\"lineChart--gradientBackgroundArea--bottom\" offset=\"100%\" /> </linearGradient> </defs>';
$('#lineChartSVG').append(html);
inFlightRequestCountChart();
Any help will be really appreciated.
Thank You!