martijn
Posts: 6
Joined: Tue Apr 12, 2011 9:08 am

IE7 bug in Point.destroy()

I have run into a problem in IE7. When running setData on an already drawn series it sometimes crashes on line 8001. The problem was that point.group.destroy() was not a function. The quick fix for me was to check if it is actually a function. I think there must be something more to this, but I do not have the time to investigate further.

The original object used to construct the chart was as follows:

Code: Select all

{
   "chart":{
      "renderTo":"ui_chart_resultsOverTime",
      "defaultSeriesType":"column",
      "backgroundColor":null,
      "plotBackgroundColor":null,
      "plotBorderWidth":null,
      "plotShadow":false
   },
   "credits":{
      "enabled":false
   },
   "legend":{
      "enabled":true
   },
   "title":{
      "text":""
   },
   "tooltip":{
      "enabled":true,
      "shared":true
   },
   "plotOptions":{
      "series":{
         "point":{
            "events":{

            }
         },
         "fillOpacity":0.1
      },
      "column":{
         "stacking":"normal"
      }
   },
   "colors":{
      "0":"#99ff99",
      "1":"#ffff99",
      "2":"#ff6666",
      "3":"#9999ff"
   },
   "xAxis":{
      "0":{
         "id":"axes_ui_widget_60",
         "type":"category",
         "visible":true,
         "tickInterval":null,
         "title":{
            "text":""
         }
      }
   },
   "yAxis":{
      "0":{
         "id":"axes_ui_widget_61",
         "type":"line",
         "visible":true,
         "tickInterval":null,
         "title":{
            "text":""
         },
         "min":0
      }
   },
   "series":{
      "0":{
         "data":{
            "0":{
               "mailing":"45504",
               "group":"45748",
               "subject":"Adboer",
               "x":112,
               "y":0
            },
            "1":{
               "mailing":"45505",
               "group":"45749",
               "subject":"Ingeroosterd naar collectie",
               "x":113,
               "y":0
            },
            "2":{
               "mailing":"45506",
               "group":"45750",
               "subject":"Ingeroosterd naar collectie",
               "x":114,
               "y":0
            },
            "3":{
               "mailing":"45507",
               "group":"45751",
               "subject":"Ingeroosterd naar collectie",
               "x":115,
               "y":0
            },
            "4":{
               "mailing":"45508",
               "group":"45752",
               "subject":"Adboer",
               "x":116,
               "y":0
            },
            "5":{
               "mailing":"45509",
               "group":"45753",
               "subject":"Send Scheduled",
               "x":117,
               "y":1
            },
            "6":{
               "mailing":"45510",
               "group":"45754",
               "subject":"Ingeroosterd naar collectie",
               "x":118,
               "y":0
            },
            "7":{
               "mailing":"45511",
               "group":"45755",
               "subject":"Send Scheduled",
               "x":119,
               "y":0
            },
            "8":{
               "mailing":"45512",
               "group":"45756",
               "subject":"La bamba!",
               "x":120,
               "y":0
            },
            "9":{
               "mailing":"45513",
               "group":"45757",
               "subject":"Adboer",
               "x":121,
               "y":1
            },
            "10":{
               "mailing":"45514",
               "group":"45758",
               "subject":"test imlib",
               "x":122,
               "y":0
            },
            "11":{
               "mailing":"45515",
               "group":"45759",
               "subject":"No destinations at all. ",
               "x":123,
               "y":0
            },
            "12":{
               "mailing":"45516",
               "group":"45760",
               "subject":"La bamba!",
               "x":124,
               "y":0
            },
            "13":{
               "mailing":"45517",
               "group":"45761",
               "subject":"La bamba!",
               "x":125,
               "y":0
            },
            "14":{
               "mailing":"45518",
               "group":"45762",
               "subject":"La bamba!",
               "x":126,
               "y":0
            },
            "15":{
               "mailing":"45519",
               "group":"45763",
               "subject":"remove the database to see what happens",
               "x":127,
               "y":1
            },
            "16":{
               "mailing":"45520",
               "group":"45764",
               "subject":"remove the database to see what happens",
               "x":128,
               "y":0
            },
            "17":{
               "mailing":"45521",
               "group":"45765",
               "subject":"archive the database to see what happens",
               "x":129,
               "y":0
            },
            "18":{
               "mailing":"45522",
               "group":"45766",
               "subject":"rename and remove the selection and then see wh...",
               "x":130,
               "y":0
            },
            "19":{
               "mailing":"45523",
               "group":"45767",
               "subject":"La bamba!",
               "x":131,
               "y":0
            },
            "20":{
               "mailing":"45524",
               "group":"45768",
               "subject":"The miniselection is removed",
               "x":132,
               "y":0
            },
            "21":{
               "mailing":"45525",
               "group":"45769",
               "subject":"The collection is removed",
               "x":133,
               "y":0
            },
            "22":{
               "mailing":"45526",
               "group":"45770",
               "subject":"Clicks from template or document",
               "x":134,
               "y":2
            }
         },
         "name":"Clicks",
         "xAxis":0,
         "yAxis":0,
         "visible":true,
         "id":"click_serie",
         "marker":{
            "enabled":false
         }
      },
      "1":{
         "data":{
            "0":{
               "mailing":"45504",
               "group":"45748",
               "subject":"Adboer",
               "x":112,
               "y":0
            },
            "1":{
               "mailing":"45505",
               "group":"45749",
               "subject":"Ingeroosterd naar collectie",
               "x":113,
               "y":0
            },
            "2":{
               "mailing":"45506",
               "group":"45750",
               "subject":"Ingeroosterd naar collectie",
               "x":114,
               "y":0
            },
            "3":{
               "mailing":"45507",
               "group":"45751",
               "subject":"Ingeroosterd naar collectie",
               "x":115,
               "y":0
            },
            "4":{
               "mailing":"45508",
               "group":"45752",
               "subject":"Adboer",
               "x":116,
               "y":0
            },
            "5":{
               "mailing":"45509",
               "group":"45753",
               "subject":"Send Scheduled",
               "x":117,
               "y":0
            },
            "6":{
               "mailing":"45510",
               "group":"45754",
               "subject":"Ingeroosterd naar collectie",
               "x":118,
               "y":0
            },
            "7":{
               "mailing":"45511",
               "group":"45755",
               "subject":"Send Scheduled",
               "x":119,
               "y":0
            },
            "8":{
               "mailing":"45512",
               "group":"45756",
               "subject":"La bamba!",
               "x":120,
               "y":0
            },
            "9":{
               "mailing":"45513",
               "group":"45757",
               "subject":"Adboer",
               "x":121,
               "y":0
            },
            "10":{
               "mailing":"45514",
               "group":"45758",
               "subject":"test imlib",
               "x":122,
               "y":0
            },
            "11":{
               "mailing":"45515",
               "group":"45759",
               "subject":"No destinations at all. ",
               "x":123,
               "y":0
            },
            "12":{
               "mailing":"45516",
               "group":"45760",
               "subject":"La bamba!",
               "x":124,
               "y":0
            },
            "13":{
               "mailing":"45517",
               "group":"45761",
               "subject":"La bamba!",
               "x":125,
               "y":0
            },
            "14":{
               "mailing":"45518",
               "group":"45762",
               "subject":"La bamba!",
               "x":126,
               "y":0
            },
            "15":{
               "mailing":"45519",
               "group":"45763",
               "subject":"remove the database to see what happens",
               "x":127,
               "y":0
            },
            "16":{
               "mailing":"45520",
               "group":"45764",
               "subject":"remove the database to see what happens",
               "x":128,
               "y":0
            },
            "17":{
               "mailing":"45521",
               "group":"45765",
               "subject":"archive the database to see what happens",
               "x":129,
               "y":0
            },
            "18":{
               "mailing":"45522",
               "group":"45766",
               "subject":"rename and remove the selection and then see wh...",
               "x":130,
               "y":1
            },
            "19":{
               "mailing":"45523",
               "group":"45767",
               "subject":"La bamba!",
               "x":131,
               "y":0
            },
            "20":{
               "mailing":"45524",
               "group":"45768",
               "subject":"The miniselection is removed",
               "x":132,
               "y":1
            },
            "21":{
               "mailing":"45525",
               "group":"45769",
               "subject":"The collection is removed",
               "x":133,
               "y":1
            },
            "22":{
               "mailing":"45526",
               "group":"45770",
               "subject":"Clicks from template or document",
               "x":134,
               "y":0
            }
         },
         "name":"Impressions",
         "xAxis":0,
         "yAxis":0,
         "visible":true,
         "id":"impr_serie",
         "marker":{
            "enabled":false
         }
      },
      "2":{
         "data":{
            "0":{
               "mailing":"45504",
               "group":"45748",
               "subject":"Adboer",
               "x":112,
               "y":0
            },
            "1":{
               "mailing":"45505",
               "group":"45749",
               "subject":"Ingeroosterd naar collectie",
               "x":113,
               "y":0
            },
            "2":{
               "mailing":"45506",
               "group":"45750",
               "subject":"Ingeroosterd naar collectie",
               "x":114,
               "y":0
            },
            "3":{
               "mailing":"45507",
               "group":"45751",
               "subject":"Ingeroosterd naar collectie",
               "x":115,
               "y":0
            },
            "4":{
               "mailing":"45508",
               "group":"45752",
               "subject":"Adboer",
               "x":116,
               "y":0
            },
            "5":{
               "mailing":"45509",
               "group":"45753",
               "subject":"Send Scheduled",
               "x":117,
               "y":0
            },
            "6":{
               "mailing":"45510",
               "group":"45754",
               "subject":"Ingeroosterd naar collectie",
               "x":118,
               "y":0
            },
            "7":{
               "mailing":"45511",
               "group":"45755",
               "subject":"Send Scheduled",
               "x":119,
               "y":0
            },
            "8":{
               "mailing":"45512",
               "group":"45756",
               "subject":"La bamba!",
               "x":120,
               "y":1
            },
            "9":{
               "mailing":"45513",
               "group":"45757",
               "subject":"Adboer",
               "x":121,
               "y":0
            },
            "10":{
               "mailing":"45514",
               "group":"45758",
               "subject":"test imlib",
               "x":122,
               "y":1
            },
            "11":{
               "mailing":"45515",
               "group":"45759",
               "subject":"No destinations at all. ",
               "x":123,
               "y":3
            },
            "12":{
               "mailing":"45516",
               "group":"45760",
               "subject":"La bamba!",
               "x":124,
               "y":1
            },
            "13":{
               "mailing":"45517",
               "group":"45761",
               "subject":"La bamba!",
               "x":125,
               "y":1
            },
            "14":{
               "mailing":"45518",
               "group":"45762",
               "subject":"La bamba!",
               "x":126,
               "y":1
            },
            "15":{
               "mailing":"45519",
               "group":"45763",
               "subject":"remove the database to see what happens",
               "x":127,
               "y":0
            },
            "16":{
               "mailing":"45520",
               "group":"45764",
               "subject":"remove the database to see what happens",
               "x":128,
               "y":0
            },
            "17":{
               "mailing":"45521",
               "group":"45765",
               "subject":"archive the database to see what happens",
               "x":129,
               "y":0
            },
            "18":{
               "mailing":"45522",
               "group":"45766",
               "subject":"rename and remove the selection and then see wh...",
               "x":130,
               "y":0
            },
            "19":{
               "mailing":"45523",
               "group":"45767",
               "subject":"La bamba!",
               "x":131,
               "y":0
            },
            "20":{
               "mailing":"45524",
               "group":"45768",
               "subject":"The miniselection is removed",
               "x":132,
               "y":0
            },
            "21":{
               "mailing":"45525",
               "group":"45769",
               "subject":"The collection is removed",
               "x":133,
               "y":0
            },
            "22":{
               "mailing":"45526",
               "group":"45770",
               "subject":"Clicks from template or document",
               "x":134,
               "y":0
            }
         },
         "name":"Errors",
         "xAxis":0,
         "yAxis":0,
         "visible":true,
         "id":"error_serie",
         "marker":{
            "enabled":false
         }
      },
      "3":{
         "data":{
            "0":{
               "mailing":"45504",
               "group":"45748",
               "subject":"Adboer",
               "x":112,
               "y":1
            },
            "1":{
               "mailing":"45505",
               "group":"45749",
               "subject":"Ingeroosterd naar collectie",
               "x":113,
               "y":1
            },
            "2":{
               "mailing":"45506",
               "group":"45750",
               "subject":"Ingeroosterd naar collectie",
               "x":114,
               "y":1
            },
            "3":{
               "mailing":"45507",
               "group":"45751",
               "subject":"Ingeroosterd naar collectie",
               "x":115,
               "y":1
            },
            "4":{
               "mailing":"45508",
               "group":"45752",
               "subject":"Adboer",
               "x":116,
               "y":1
            },
            "5":{
               "mailing":"45509",
               "group":"45753",
               "subject":"Send Scheduled",
               "x":117,
               "y":0
            },
            "6":{
               "mailing":"45510",
               "group":"45754",
               "subject":"Ingeroosterd naar collectie",
               "x":118,
               "y":1
            },
            "7":{
               "mailing":"45511",
               "group":"45755",
               "subject":"Send Scheduled",
               "x":119,
               "y":1
            },
            "8":{
               "mailing":"45512",
               "group":"45756",
               "subject":"La bamba!",
               "x":120,
               "y":0
            },
            "9":{
               "mailing":"45513",
               "group":"45757",
               "subject":"Adboer",
               "x":121,
               "y":0
            },
            "10":{
               "mailing":"45514",
               "group":"45758",
               "subject":"test imlib",
               "x":122,
               "y":0
            },
            "11":{
               "mailing":"45515",
               "group":"45759",
               "subject":"No destinations at all. ",
               "x":123,
               "y":0
            },
            "12":{
               "mailing":"45516",
               "group":"45760",
               "subject":"La bamba!",
               "x":124,
               "y":0
            },
            "13":{
               "mailing":"45517",
               "group":"45761",
               "subject":"La bamba!",
               "x":125,
               "y":0
            },
            "14":{
               "mailing":"45518",
               "group":"45762",
               "subject":"La bamba!",
               "x":126,
               "y":0
            },
            "15":{
               "mailing":"45519",
               "group":"45763",
               "subject":"remove the database to see what happens",
               "x":127,
               "y":0
            },
            "16":{
               "mailing":"45520",
               "group":"45764",
               "subject":"remove the database to see what happens",
               "x":128,
               "y":1
            },
            "17":{
               "mailing":"45521",
               "group":"45765",
               "subject":"archive the database to see what happens",
               "x":129,
               "y":1
            },
            "18":{
               "mailing":"45522",
               "group":"45766",
               "subject":"rename and remove the selection and then see wh...",
               "x":130,
               "y":0
            },
            "19":{
               "mailing":"45523",
               "group":"45767",
               "subject":"La bamba!",
               "x":131,
               "y":0
            },
            "20":{
               "mailing":"45524",
               "group":"45768",
               "subject":"The miniselection is removed",
               "x":132,
               "y":0
            },
            "21":{
               "mailing":"45525",
               "group":"45769",
               "subject":"The collection is removed",
               "x":133,
               "y":0
            },
            "22":{
               "mailing":"45526",
               "group":"45770",
               "subject":"Clicks from template or document",
               "x":134,
               "y":0
            }
         },
         "name":"None",
         "xAxis":0,
         "yAxis":0,
         "visible":true,
         "id":"none_serie",
         "marker":{
            "enabled":false
         }
      }
   }
}
Running any setData command on any of the chart series fails in IE7. To fix this I have changed the following:

Code: Select all

Index: highcharts/highcharts.src.js
===================================================================
--- highcharts/highcharts.src.js	(revision 55841)
+++ highcharts/highcharts.src.js	(working copy)
@@ -7997,7 +7997,7 @@
 		removeEvent(point);
 		
 		each(['graphic', 'tracker', 'group', 'dataLabel', 'connector'], function(prop) {
-			if (point[prop]) {
+			if (point[prop] && typeof point[prop].destroy == 'function') {
 				point[prop].destroy();
 			}
 		});		
I have not noticed any residual things not getting destroyed because of this.

Return to “Highcharts Usage”