mhoennig
Posts: 8
Joined: Mon Jun 07, 2010 4:56 pm

k is null / config is null - with patch

Dear HIghChart team,

When trying to add export buttons to a chart on a page which also uses some other JS libraries, as which come from myFaces, I got this JS error in exprting.js: "k is null" respectively "config is null" in exporting.src.js. The error did occor in the following line starting with "typeof":

Code: Select all

				// extend the options by those values that can be expressed in a number or array config
				config = point.config;
				pointOptions = extend(
					typeof config == 'object' && config.constructor != Array && point.config, {
						x: point.x,
						y: point.y,
						name: point.name
					}
				);
The line was confusing to me as the null check came after using the variable and additionally the same value was referred by point.config as well as config. I changed this line to:

Code: Select all

config && typeof config == 'object' && config.constructor != Array, {
And it works! The exported chart also looks fine.

Thanks for your attention.
... Michael

Return to “Highcharts Usage”