minor bug fix
[openemr.git] / library / openflashchart / js-ofc-library / ofc.js
blob1ca3a9ecc595cf29f41da8221fb32a1d2b934911
1 function findSWF(movieName) {
2   if (navigator.appName.indexOf("Microsoft")!= -1) {
3     return window[movieName];
4   } else {
5     return document[movieName];
6   }
10 /**
11  * @param index as integer.
12  *
13  * Returns a CLONE of the chart with one of the elements removed
14  */
15 function chart_remove_element(chart, index)
17     
18  //   global_showing_old_data = !global_showing_old_data;
19     
20     // clone the chart
21     var modified_chart = {};
22     jQuery.extend(modified_chart, chart);
24     // remove the old data from the chart:
25     var element = modified_chart.elements[1];
26     var elements = new Array();
27     var c=0;
28     for(i=0; i<modified_chart.elements.length; i++)
29     {
30       if(i!=index)
31       {
32         elements[c] = modified_chart.elements[i];
33         c++;
34       }
35     }
36     modified_chart.elements = elements;
37     return modified_chart;