corrade-nucleus-nucleons – Blame information for rev

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /**
2 * @license Highcharts JS v5.0.10 (2017-03-31)
3 * Exporting module
4 *
5 * (c) 2010-2017 Torstein Honsi
6 *
7 * License: www.highcharts.com/license
8 */
9 'use strict';
10 (function(factory) {
11 if (typeof module === 'object' && module.exports) {
12 module.exports = factory;
13 } else {
14 factory(Highcharts);
15 }
16 }(function(Highcharts) {
17 (function(H) {
18 /**
19 * Exporting module
20 *
21 * (c) 2010-2017 Torstein Honsi
22 *
23 * License: www.highcharts.com/license
24 */
25  
26 /* eslint indent:0 */
27  
28 // create shortcuts
29 var defaultOptions = H.defaultOptions,
30 doc = H.doc,
31 Chart = H.Chart,
32 addEvent = H.addEvent,
33 removeEvent = H.removeEvent,
34 fireEvent = H.fireEvent,
35 createElement = H.createElement,
36 discardElement = H.discardElement,
37 css = H.css,
38 merge = H.merge,
39 pick = H.pick,
40 each = H.each,
41 extend = H.extend,
42 isTouchDevice = H.isTouchDevice,
43 win = H.win,
44 SVGRenderer = H.SVGRenderer;
45  
46 var symbols = H.Renderer.prototype.symbols;
47  
48 // Add language
49 extend(defaultOptions.lang, {
50 printChart: 'Print chart',
51 downloadPNG: 'Download PNG image',
52 downloadJPEG: 'Download JPEG image',
53 downloadPDF: 'Download PDF document',
54 downloadSVG: 'Download SVG vector image',
55 contextButtonTitle: 'Chart context menu'
56 });
57  
58 // Buttons and menus are collected in a separate config option set called 'navigation'.
59 // This can be extended later to add control buttons like zoom and pan right click menus.
60 defaultOptions.navigation = {
61 buttonOptions: {
62 theme: {},
63 symbolSize: 14,
64 symbolX: 12.5,
65 symbolY: 10.5,
66 align: 'right',
67 buttonSpacing: 3,
68 height: 22,
69 // text: null,
70 verticalAlign: 'top',
71 width: 24
72 }
73 };
74  
75  
76 // Presentational attributes
77 merge(true, defaultOptions.navigation, {
78 menuStyle: {
79 border: '1px solid #999999',
80 background: '#ffffff',
81 padding: '5px 0'
82 },
83 menuItemStyle: {
84 padding: '0.5em 1em',
85 background: 'none',
86 color: '#333333',
87 fontSize: isTouchDevice ? '14px' : '11px',
88 transition: 'background 250ms, color 250ms'
89 },
90 menuItemHoverStyle: {
91 background: '#335cad',
92 color: '#ffffff'
93 },
94 buttonOptions: {
95 symbolFill: '#666666',
96 symbolStroke: '#666666',
97 symbolStrokeWidth: 3,
98 theme: {
99 fill: '#ffffff', // capture hover
100 stroke: 'none',
101 padding: 5
102 }
103 }
104 });
105  
106  
107  
108 // Add the export related options
109 defaultOptions.exporting = {
110 //enabled: true,
111 //filename: 'chart',
112 type: 'image/png',
113 url: 'https://export.highcharts.com/',
114 //width: undefined,
115 printMaxWidth: 780,
116 scale: 2,
117 buttons: {
118 contextButton: {
119 className: 'highcharts-contextbutton',
120 menuClassName: 'highcharts-contextmenu',
121 //x: -10,
122 symbol: 'menu',
123 _titleKey: 'contextButtonTitle',
124 menuItems: [{
125 textKey: 'printChart',
126 onclick: function() {
127 this.print();
128 }
129 }, {
130 separator: true
131 }, {
132 textKey: 'downloadPNG',
133 onclick: function() {
134 this.exportChart();
135 }
136 }, {
137 textKey: 'downloadJPEG',
138 onclick: function() {
139 this.exportChart({
140 type: 'image/jpeg'
141 });
142 }
143 }, {
144 textKey: 'downloadPDF',
145 onclick: function() {
146 this.exportChart({
147 type: 'application/pdf'
148 });
149 }
150 }, {
151 textKey: 'downloadSVG',
152 onclick: function() {
153 this.exportChart({
154 type: 'image/svg+xml'
155 });
156 }
157 }
158 // Enable this block to add "View SVG" to the dropdown menu
159 /*
160 ,{
161  
162 text: 'View SVG Image',
163 onclick: function () {
164 var div = doc.createElement('div');
165 div.innerHTML = this.getSVGForExport();
166  
167 this.renderTo.parentNode.appendChild(div);
168 }
169 }, {
170  
171 text: 'View SVG Source',
172 onclick: function () {
173 var pre = doc.createElement('pre');
174 pre.innerHTML = this.getSVGForExport()
175 .replace(/</g, '\n&lt;')
176 .replace(/>/g, '&gt;');
177  
178 this.renderTo.parentNode.appendChild(pre);
179 }
180 }
181 // */
182 ]
183 }
184 }
185 };
186  
187 // Add the H.post utility
188 H.post = function(url, data, formAttributes) {
189 var name,
190 form;
191  
192 // create the form
193 form = createElement('form', merge({
194 method: 'post',
195 action: url,
196 enctype: 'multipart/form-data'
197 }, formAttributes), {
198 display: 'none'
199 }, doc.body);
200  
201 // add the data
202 for (name in data) {
203 createElement('input', {
204 type: 'hidden',
205 name: name,
206 value: data[name]
207 }, null, form);
208 }
209  
210 // submit
211 form.submit();
212  
213 // clean up
214 discardElement(form);
215 };
216  
217 extend(Chart.prototype, {
218  
219 /**
220 * A collection of fixes on the produced SVG to account for expando properties,
221 * browser bugs, VML problems and other. Returns a cleaned SVG.
222 */
223 sanitizeSVG: function(svg, options) {
224 // Move HTML into a foreignObject
225 if (options && options.exporting && options.exporting.allowHTML) {
226 var html = svg.match(/<\/svg>(.*?$)/);
227 <\/svg> if (html && html[1]) {
228 <\/svg> html = '<foreignObject x="0" y="0" ' +
229 <\/svg> 'width="' + options.chart.width + '" ' +
230 <\/svg> 'height="' + options.chart.height + '">' +
231 <\/svg> '<body xmlns="http://www.w3.org/1999/xhtml">' +
232 <\/svg> html[1] +
233 <\/svg> '</body>' +
234 <\/svg> '</foreignObject>';
235 <\/svg> svg = svg.replace('</svg>', html + '</svg>');
236 <\/svg> }
237 <\/svg> }
238  
239 <\/svg> svg = svg
240 <\/svg> .replace(/zIndex="[^"]+"/g, '')
241 <\/svg> .replace(/isShadow="[^"]+"/g, '')
242 <\/svg> .replace(/symbolName="[^"]+"/g, '')
243 <\/svg> .replace(/jQuery[0-9]+="[^"]+"/g, '')
244 <\/svg> .replace(/url\(("|")(\S+)("|")\)/g, 'url($2)')
245 <\/svg> .replace(/url\([^#]+#/g, 'url(#')
246 <\/svg> .replace(/, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
247 <\/svg> .replace(/ (NS[0-9]+\:)?href=/g, ' xlink:href=') // #3567
248 <\/svg> .replace(/\n/, ' ')
249 <\/svg> // Any HTML added to the container after the SVG (#894)
250 <\/svg> .replace(/<\/svg>.*?$/, '</svg>')
251 <\/svg><\/svg> // Batik doesn't support rgba fills and strokes (#3095)
252 <\/svg><\/svg> .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"')
253 <\/svg><\/svg> /* This fails in IE < 8
254 <\/svg><\/svg> .replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
255 <\/svg><\/svg> return s2 +'.'+ s3[0];
256 <\/svg><\/svg> })*/
257  
258 <\/svg><\/svg> // Replace HTML entities, issue #347
259 <\/svg><\/svg> .replace(/ /g, '\u00A0') // no-break space
260 <\/svg><\/svg> .replace(/­/g, '\u00AD'); // soft hyphen
261  
262  
263 <\/svg><\/svg> // IE specific
264 <\/svg><\/svg> svg = svg
265 <\/svg><\/svg> .replace(/g, '<image ')
266 <\/svg><\/svg> .replace(/<(\/?)TITLE>/g, '<$1title>')
267 <\/svg><\/svg><(\/?)TITLE> .replace(/height=([^" ]+)/g, 'height="$1"')
268 <\/svg><\/svg><(\/?)TITLE> .replace(/width=([^" ]+)/g, 'width="$1"')
269 <\/svg><\/svg><(\/?)TITLE> .replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
270 <\/svg><\/svg><(\/?)TITLE> .replace(/ id=([^" >]+)/g, ' id="$1"') // #4003
271 <\/svg><\/svg><(\/?)TITLE> .replace(/class=([^" >]+)/g, 'class="$1"')
272 <\/svg><\/svg><(\/?)TITLE> .replace(/ transform /g, ' ')
273 <\/svg><\/svg><(\/?)TITLE> .replace(/:(path|rect)/g, '$1')
274 <\/svg><\/svg><(\/?)TITLE> .replace(/style="([^"]+)"/g, function(s) {
275 <\/svg><\/svg><(\/?)TITLE> return s.toLowerCase();
276 <\/svg><\/svg><(\/?)TITLE> });
277  
278  
279 <\/svg><\/svg><(\/?)TITLE> return svg;
280 <\/svg><\/svg><(\/?)TITLE> },
281  
282 <\/svg><\/svg><(\/?)TITLE> /**
283 <\/svg><\/svg><(\/?)TITLE> * Return innerHTML of chart. Used as hook for plugins.
284 <\/svg><\/svg><(\/?)TITLE> */
285 <\/svg><\/svg><(\/?)TITLE> getChartHTML: function() {
286  
287 <\/svg><\/svg><(\/?)TITLE> return this.container.innerHTML;
288 <\/svg><\/svg><(\/?)TITLE> },
289  
290 <\/svg><\/svg><(\/?)TITLE> /**
291 <\/svg><\/svg><(\/?)TITLE> * Return an SVG representation of the chart.
292 <\/svg><\/svg><(\/?)TITLE> *
293 <\/svg><\/svg><(\/?)TITLE> * @param additionalOptions {Object} Additional chart options for the
294 <\/svg><\/svg><(\/?)TITLE> * generated SVG representation. For collections like `xAxis`, `yAxis` or
295 <\/svg><\/svg><(\/?)TITLE> * `series`, the additional options is either merged in to the orininal
296 <\/svg><\/svg><(\/?)TITLE> * item of the same `id`, or to the first item if a commin id is not
297 <\/svg><\/svg><(\/?)TITLE> * found.
298 <\/svg><\/svg><(\/?)TITLE> */
299 <\/svg><\/svg><(\/?)TITLE> getSVG: function(additionalOptions) {
300 <\/svg><\/svg><(\/?)TITLE> var chart = this,
301 <\/svg><\/svg><(\/?)TITLE> chartCopy,
302 <\/svg><\/svg><(\/?)TITLE> sandbox,
303 <\/svg><\/svg><(\/?)TITLE> svg,
304 <\/svg><\/svg><(\/?)TITLE> seriesOptions,
305 <\/svg><\/svg><(\/?)TITLE> sourceWidth,
306 <\/svg><\/svg><(\/?)TITLE> sourceHeight,
307 <\/svg><\/svg><(\/?)TITLE> cssWidth,
308 <\/svg><\/svg><(\/?)TITLE> cssHeight,
309 <\/svg><\/svg><(\/?)TITLE> options = merge(chart.options, additionalOptions); // copy the options and add extra options
310  
311  
312 <\/svg><\/svg><(\/?)TITLE> // IE compatibility hack for generating SVG content that it doesn't really understand
313 <\/svg><\/svg><(\/?)TITLE> if (!doc.createElementNS) {
314 <\/svg><\/svg><(\/?)TITLE> doc.createElementNS = function(ns, tagName) {
315 <\/svg><\/svg><(\/?)TITLE> return doc.createElement(tagName);
316 <\/svg><\/svg><(\/?)TITLE> };
317 <\/svg><\/svg><(\/?)TITLE> }
318  
319 <\/svg><\/svg><(\/?)TITLE> // create a sandbox where a new chart will be generated
320 <\/svg><\/svg><(\/?)TITLE> sandbox = createElement('div', null, {
321 <\/svg><\/svg><(\/?)TITLE> position: 'absolute',
322 <\/svg><\/svg><(\/?)TITLE> top: '-9999em',
323 <\/svg><\/svg><(\/?)TITLE> width: chart.chartWidth + 'px',
324 <\/svg><\/svg><(\/?)TITLE> height: chart.chartHeight + 'px'
325 <\/svg><\/svg><(\/?)TITLE> }, doc.body);
326  
327 <\/svg><\/svg><(\/?)TITLE> // get the source size
328 <\/svg><\/svg><(\/?)TITLE> cssWidth = chart.renderTo.style.width;
329 <\/svg><\/svg><(\/?)TITLE> cssHeight = chart.renderTo.style.height;
330 <\/svg><\/svg><(\/?)TITLE> sourceWidth = options.exporting.sourceWidth ||
331 <\/svg><\/svg><(\/?)TITLE> options.chart.width ||
332 <\/svg><\/svg><(\/?)TITLE> (/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
333 <\/svg><\/svg><(\/?)TITLE> 600;
334 <\/svg><\/svg><(\/?)TITLE> sourceHeight = options.exporting.sourceHeight ||
335 <\/svg><\/svg><(\/?)TITLE> options.chart.height ||
336 <\/svg><\/svg><(\/?)TITLE> (/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
337 <\/svg><\/svg><(\/?)TITLE> 400;
338  
339 <\/svg><\/svg><(\/?)TITLE> // override some options
340 <\/svg><\/svg><(\/?)TITLE> extend(options.chart, {
341 <\/svg><\/svg><(\/?)TITLE> animation: false,
342 <\/svg><\/svg><(\/?)TITLE> renderTo: sandbox,
343 <\/svg><\/svg><(\/?)TITLE> forExport: true,
344 <\/svg><\/svg><(\/?)TITLE> renderer: 'SVGRenderer',
345 <\/svg><\/svg><(\/?)TITLE> width: sourceWidth,
346 <\/svg><\/svg><(\/?)TITLE> height: sourceHeight
347 <\/svg><\/svg><(\/?)TITLE> });
348 <\/svg><\/svg><(\/?)TITLE> options.exporting.enabled = false; // hide buttons in print
349 <\/svg><\/svg><(\/?)TITLE> delete options.data; // #3004
350  
351 <\/svg><\/svg><(\/?)TITLE> // prepare for replicating the chart
352 <\/svg><\/svg><(\/?)TITLE> options.series = [];
353 <\/svg><\/svg><(\/?)TITLE> each(chart.series, function(serie) {
354 <\/svg><\/svg><(\/?)TITLE> seriesOptions = merge(serie.userOptions, { // #4912
355 <\/svg><\/svg><(\/?)TITLE> animation: false, // turn off animation
356 <\/svg><\/svg><(\/?)TITLE> enableMouseTracking: false,
357 <\/svg><\/svg><(\/?)TITLE> showCheckbox: false,
358 <\/svg><\/svg><(\/?)TITLE> visible: serie.visible
359 <\/svg><\/svg><(\/?)TITLE> });
360  
361 <\/svg><\/svg><(\/?)TITLE> if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
362 <\/svg><\/svg><(\/?)TITLE> options.series.push(seriesOptions);
363 <\/svg><\/svg><(\/?)TITLE> }
364 <\/svg><\/svg><(\/?)TITLE> });
365  
366 <\/svg><\/svg><(\/?)TITLE> // Assign an internal key to ensure a one-to-one mapping (#5924)
367 <\/svg><\/svg><(\/?)TITLE> each(chart.axes, function(axis) {
368 <\/svg><\/svg><(\/?)TITLE> if (!axis.userOptions.internalKey) { // #6444
369 <\/svg><\/svg><(\/?)TITLE> axis.userOptions.internalKey = H.uniqueKey();
370 <\/svg><\/svg><(\/?)TITLE> }
371 <\/svg><\/svg><(\/?)TITLE> });
372  
373 <\/svg><\/svg><(\/?)TITLE> // generate the chart copy
374 <\/svg><\/svg><(\/?)TITLE> chartCopy = new H.Chart(options, chart.callback);
375  
376 <\/svg><\/svg><(\/?)TITLE> // Axis options and series options (#2022, #3900, #5982)
377 <\/svg><\/svg><(\/?)TITLE> if (additionalOptions) {
378 <\/svg><\/svg><(\/?)TITLE> each(['xAxis', 'yAxis', 'series'], function(coll) {
379 <\/svg><\/svg><(\/?)TITLE> var collOptions = {};
380 <\/svg><\/svg><(\/?)TITLE> if (additionalOptions[coll]) {
381 <\/svg><\/svg><(\/?)TITLE> collOptions[coll] = additionalOptions[coll];
382 <\/svg><\/svg><(\/?)TITLE> chartCopy.update(collOptions);
383 <\/svg><\/svg><(\/?)TITLE> }
384 <\/svg><\/svg><(\/?)TITLE> });
385 <\/svg><\/svg><(\/?)TITLE> }
386  
387 <\/svg><\/svg><(\/?)TITLE> // Reflect axis extremes in the export (#5924)
388 <\/svg><\/svg><(\/?)TITLE> each(chart.axes, function(axis) {
389 <\/svg><\/svg><(\/?)TITLE> var axisCopy = H.find(chartCopy.axes, function(copy) {
390 <\/svg><\/svg><(\/?)TITLE> return copy.options.internalKey ===
391 <\/svg><\/svg><(\/?)TITLE> axis.userOptions.internalKey;
392 <\/svg><\/svg><(\/?)TITLE> }),
393 <\/svg><\/svg><(\/?)TITLE> extremes = axis.getExtremes(),
394 <\/svg><\/svg><(\/?)TITLE> userMin = extremes.userMin,
395 <\/svg><\/svg><(\/?)TITLE> userMax = extremes.userMax;
396  
397 <\/svg><\/svg><(\/?)TITLE> if (axisCopy && (userMin !== undefined || userMax !== undefined)) {
398 <\/svg><\/svg><(\/?)TITLE> axisCopy.setExtremes(userMin, userMax, true, false);
399 <\/svg><\/svg><(\/?)TITLE> }
400 <\/svg><\/svg><(\/?)TITLE> });
401  
402 <\/svg><\/svg><(\/?)TITLE> // Get the SVG from the container's innerHTML
403 <\/svg><\/svg><(\/?)TITLE> svg = chartCopy.getChartHTML();
404  
405 <\/svg><\/svg><(\/?)TITLE> svg = chart.sanitizeSVG(svg, options);
406  
407 <\/svg><\/svg><(\/?)TITLE> // free up memory
408 <\/svg><\/svg><(\/?)TITLE> options = null;
409 <\/svg><\/svg><(\/?)TITLE> chartCopy.destroy();
410 <\/svg><\/svg><(\/?)TITLE> discardElement(sandbox);
411  
412 <\/svg><\/svg><(\/?)TITLE> return svg;
413 <\/svg><\/svg><(\/?)TITLE> },
414  
415 <\/svg><\/svg><(\/?)TITLE> getSVGForExport: function(options, chartOptions) {
416 <\/svg><\/svg><(\/?)TITLE> var chartExportingOptions = this.options.exporting;
417  
418 <\/svg><\/svg><(\/?)TITLE> return this.getSVG(merge({
419 <\/svg><\/svg><(\/?)TITLE> chart: {
420 <\/svg><\/svg><(\/?)TITLE> borderRadius: 0
421 <\/svg><\/svg><(\/?)TITLE> }
422 <\/svg><\/svg><(\/?)TITLE> },
423 <\/svg><\/svg><(\/?)TITLE> chartExportingOptions.chartOptions,
424 <\/svg><\/svg><(\/?)TITLE> chartOptions, {
425 <\/svg><\/svg><(\/?)TITLE> exporting: {
426 <\/svg><\/svg><(\/?)TITLE> sourceWidth: (options && options.sourceWidth) || chartExportingOptions.sourceWidth,
427 <\/svg><\/svg><(\/?)TITLE> sourceHeight: (options && options.sourceHeight) || chartExportingOptions.sourceHeight
428 <\/svg><\/svg><(\/?)TITLE> }
429 <\/svg><\/svg><(\/?)TITLE> }
430 <\/svg><\/svg><(\/?)TITLE> ));
431 <\/svg><\/svg><(\/?)TITLE> },
432  
433 <\/svg><\/svg><(\/?)TITLE> /**
434 <\/svg><\/svg><(\/?)TITLE> * Submit the SVG representation of the chart to the server
435 <\/svg><\/svg><(\/?)TITLE> * @param {Object} options Exporting options. Possible members are url, type, width and formAttributes.
436 <\/svg><\/svg><(\/?)TITLE> * @param {Object} chartOptions Additional chart options for the SVG representation of the chart
437 <\/svg><\/svg><(\/?)TITLE> */
438 <\/svg><\/svg><(\/?)TITLE> exportChart: function(options, chartOptions) {
439  
440 <\/svg><\/svg><(\/?)TITLE> var svg = this.getSVGForExport(options, chartOptions);
441  
442 <\/svg><\/svg><(\/?)TITLE> // merge the options
443 <\/svg><\/svg><(\/?)TITLE> options = merge(this.options.exporting, options);
444  
445 <\/svg><\/svg><(\/?)TITLE> // do the post
446 <\/svg><\/svg><(\/?)TITLE> H.post(options.url, {
447 <\/svg><\/svg><(\/?)TITLE> filename: options.filename || 'chart',
448 <\/svg><\/svg><(\/?)TITLE> type: options.type,
449 <\/svg><\/svg><(\/?)TITLE> width: options.width || 0, // IE8 fails to post undefined correctly, so use 0
450 <\/svg><\/svg><(\/?)TITLE> scale: options.scale,
451 <\/svg><\/svg><(\/?)TITLE> svg: svg
452 <\/svg><\/svg><(\/?)TITLE> }, options.formAttributes);
453  
454 <\/svg><\/svg><(\/?)TITLE> },
455  
456 <\/svg><\/svg><(\/?)TITLE> /**
457 <\/svg><\/svg><(\/?)TITLE> * Print the chart
458 <\/svg><\/svg><(\/?)TITLE> */
459 <\/svg><\/svg><(\/?)TITLE> print: function() {
460  
461 <\/svg><\/svg><(\/?)TITLE> var chart = this,
462 <\/svg><\/svg><(\/?)TITLE> container = chart.container,
463 <\/svg><\/svg><(\/?)TITLE> origDisplay = [],
464 <\/svg><\/svg><(\/?)TITLE> origParent = container.parentNode,
465 <\/svg><\/svg><(\/?)TITLE> body = doc.body,
466 <\/svg><\/svg><(\/?)TITLE> childNodes = body.childNodes,
467 <\/svg><\/svg><(\/?)TITLE> printMaxWidth = chart.options.exporting.printMaxWidth,
468 <\/svg><\/svg><(\/?)TITLE> resetParams,
469 <\/svg><\/svg><(\/?)TITLE> handleMaxWidth;
470  
471 <\/svg><\/svg><(\/?)TITLE> if (chart.isPrinting) { // block the button while in printing mode
472 <\/svg><\/svg><(\/?)TITLE> return;
473 <\/svg><\/svg><(\/?)TITLE> }
474  
475 <\/svg><\/svg><(\/?)TITLE> chart.isPrinting = true;
476 <\/svg><\/svg><(\/?)TITLE> chart.pointer.reset(null, 0);
477  
478 <\/svg><\/svg><(\/?)TITLE> fireEvent(chart, 'beforePrint');
479  
480 <\/svg><\/svg><(\/?)TITLE> // Handle printMaxWidth
481 <\/svg><\/svg><(\/?)TITLE> handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
482 <\/svg><\/svg><(\/?)TITLE> if (handleMaxWidth) {
483 <\/svg><\/svg><(\/?)TITLE> resetParams = [chart.options.chart.width, undefined, false];
484 <\/svg><\/svg><(\/?)TITLE> chart.setSize(printMaxWidth, undefined, false);
485 <\/svg><\/svg><(\/?)TITLE> }
486  
487 <\/svg><\/svg><(\/?)TITLE> // hide all body content
488 <\/svg><\/svg><(\/?)TITLE> each(childNodes, function(node, i) {
489 <\/svg><\/svg><(\/?)TITLE> if (node.nodeType === 1) {
490 <\/svg><\/svg><(\/?)TITLE> origDisplay[i] = node.style.display;
491 <\/svg><\/svg><(\/?)TITLE> node.style.display = 'none';
492 <\/svg><\/svg><(\/?)TITLE> }
493 <\/svg><\/svg><(\/?)TITLE> });
494  
495 <\/svg><\/svg><(\/?)TITLE> // pull out the chart
496 <\/svg><\/svg><(\/?)TITLE> body.appendChild(container);
497  
498 <\/svg><\/svg><(\/?)TITLE> // print
499 <\/svg><\/svg><(\/?)TITLE> win.focus(); // #1510
500 <\/svg><\/svg><(\/?)TITLE> win.print();
501  
502 <\/svg><\/svg><(\/?)TITLE> // allow the browser to prepare before reverting
503 <\/svg><\/svg><(\/?)TITLE> setTimeout(function() {
504  
505 <\/svg><\/svg><(\/?)TITLE> // put the chart back in
506 <\/svg><\/svg><(\/?)TITLE> origParent.appendChild(container);
507  
508 <\/svg><\/svg><(\/?)TITLE> // restore all body content
509 <\/svg><\/svg><(\/?)TITLE> each(childNodes, function(node, i) {
510 <\/svg><\/svg><(\/?)TITLE> if (node.nodeType === 1) {
511 <\/svg><\/svg><(\/?)TITLE> node.style.display = origDisplay[i];
512 <\/svg><\/svg><(\/?)TITLE> }
513 <\/svg><\/svg><(\/?)TITLE> });
514  
515 <\/svg><\/svg><(\/?)TITLE> chart.isPrinting = false;
516  
517 <\/svg><\/svg><(\/?)TITLE> // Reset printMaxWidth
518 <\/svg><\/svg><(\/?)TITLE> if (handleMaxWidth) {
519 <\/svg><\/svg><(\/?)TITLE> chart.setSize.apply(chart, resetParams);
520 <\/svg><\/svg><(\/?)TITLE> }
521  
522 <\/svg><\/svg><(\/?)TITLE> fireEvent(chart, 'afterPrint');
523  
524 <\/svg><\/svg><(\/?)TITLE> }, 1000);
525  
526 <\/svg><\/svg><(\/?)TITLE> },
527  
528 <\/svg><\/svg><(\/?)TITLE> /**
529 <\/svg><\/svg><(\/?)TITLE> * Display a popup menu for choosing the export type
530 <\/svg><\/svg><(\/?)TITLE> *
531 <\/svg><\/svg><(\/?)TITLE> * @param {String} className An identifier for the menu
532 <\/svg><\/svg><(\/?)TITLE> * @param {Array} items A collection with text and onclicks for the items
533 <\/svg><\/svg><(\/?)TITLE> * @param {Number} x The x position of the opener button
534 <\/svg><\/svg><(\/?)TITLE> * @param {Number} y The y position of the opener button
535 <\/svg><\/svg><(\/?)TITLE> * @param {Number} width The width of the opener button
536 <\/svg><\/svg><(\/?)TITLE> * @param {Number} height The height of the opener button
537 <\/svg><\/svg><(\/?)TITLE> */
538 <\/svg><\/svg><(\/?)TITLE> contextMenu: function(className, items, x, y, width, height, button) {
539 <\/svg><\/svg><(\/?)TITLE> var chart = this,
540 <\/svg><\/svg><(\/?)TITLE> navOptions = chart.options.navigation,
541 <\/svg><\/svg><(\/?)TITLE> chartWidth = chart.chartWidth,
542 <\/svg><\/svg><(\/?)TITLE> chartHeight = chart.chartHeight,
543 <\/svg><\/svg><(\/?)TITLE> cacheName = 'cache-' + className,
544 <\/svg><\/svg><(\/?)TITLE> menu = chart[cacheName],
545 <\/svg><\/svg><(\/?)TITLE> menuPadding = Math.max(width, height), // for mouse leave detection
546 <\/svg><\/svg><(\/?)TITLE> innerMenu,
547 <\/svg><\/svg><(\/?)TITLE> hide,
548 <\/svg><\/svg><(\/?)TITLE> menuStyle;
549  
550 <\/svg><\/svg><(\/?)TITLE> // create the menu only the first time
551 <\/svg><\/svg><(\/?)TITLE> if (!menu) {
552  
553 <\/svg><\/svg><(\/?)TITLE> // create a HTML element above the SVG
554 <\/svg><\/svg><(\/?)TITLE> chart[cacheName] = menu = createElement('div', {
555 <\/svg><\/svg><(\/?)TITLE> className: className
556 <\/svg><\/svg><(\/?)TITLE> }, {
557 <\/svg><\/svg><(\/?)TITLE> position: 'absolute',
558 <\/svg><\/svg><(\/?)TITLE> zIndex: 1000,
559 <\/svg><\/svg><(\/?)TITLE> padding: menuPadding + 'px'
560 <\/svg><\/svg><(\/?)TITLE> }, chart.container);
561  
562 <\/svg><\/svg><(\/?)TITLE> innerMenu = createElement('div', {
563 <\/svg><\/svg><(\/?)TITLE> className: 'highcharts-menu'
564 <\/svg><\/svg><(\/?)TITLE> }, null, menu);
565  
566  
567 <\/svg><\/svg><(\/?)TITLE> // Presentational CSS
568 <\/svg><\/svg><(\/?)TITLE> css(innerMenu, extend({
569 <\/svg><\/svg><(\/?)TITLE> MozBoxShadow: '3px 3px 10px #888',
570 <\/svg><\/svg><(\/?)TITLE> WebkitBoxShadow: '3px 3px 10px #888',
571 <\/svg><\/svg><(\/?)TITLE> boxShadow: '3px 3px 10px #888'
572 <\/svg><\/svg><(\/?)TITLE> }, navOptions.menuStyle));
573  
574  
575 <\/svg><\/svg><(\/?)TITLE> // hide on mouse out
576 <\/svg><\/svg><(\/?)TITLE> hide = function() {
577 <\/svg><\/svg><(\/?)TITLE> css(menu, {
578 <\/svg><\/svg><(\/?)TITLE> display: 'none'
579 <\/svg><\/svg><(\/?)TITLE> });
580 <\/svg><\/svg><(\/?)TITLE> if (button) {
581 <\/svg><\/svg><(\/?)TITLE> button.setState(0);
582 <\/svg><\/svg><(\/?)TITLE> }
583 <\/svg><\/svg><(\/?)TITLE> chart.openMenu = false;
584 <\/svg><\/svg><(\/?)TITLE> };
585  
586 <\/svg><\/svg><(\/?)TITLE> // Hide the menu some time after mouse leave (#1357)
587 <\/svg><\/svg><(\/?)TITLE> chart.exportEvents.push(
588 <\/svg><\/svg><(\/?)TITLE> addEvent(menu, 'mouseleave', function() {
589 <\/svg><\/svg><(\/?)TITLE> menu.hideTimer = setTimeout(hide, 500);
590 <\/svg><\/svg><(\/?)TITLE> }),
591 <\/svg><\/svg><(\/?)TITLE> addEvent(menu, 'mouseenter', function() {
592 <\/svg><\/svg><(\/?)TITLE> clearTimeout(menu.hideTimer);
593 <\/svg><\/svg><(\/?)TITLE> }),
594  
595 <\/svg><\/svg><(\/?)TITLE> // Hide it on clicking or touching outside the menu (#2258, #2335,
596 <\/svg><\/svg><(\/?)TITLE> // #2407)
597 <\/svg><\/svg><(\/?)TITLE> addEvent(doc, 'mouseup', function(e) {
598 <\/svg><\/svg><(\/?)TITLE> if (!chart.pointer.inClass(e.target, className)) {
599 <\/svg><\/svg><(\/?)TITLE> hide();
600 <\/svg><\/svg><(\/?)TITLE> }
601 <\/svg><\/svg><(\/?)TITLE> })
602 <\/svg><\/svg><(\/?)TITLE> );
603  
604 <\/svg><\/svg><(\/?)TITLE> // create the items
605 <\/svg><\/svg><(\/?)TITLE> each(items, function(item) {
606 <\/svg><\/svg><(\/?)TITLE> if (item) {
607 <\/svg><\/svg><(\/?)TITLE> var element;
608  
609 <\/svg><\/svg><(\/?)TITLE> if (item.separator) {
610 <\/svg><\/svg><(\/?)TITLE> element = createElement('hr', null, null, innerMenu);
611  
612 <\/svg><\/svg><(\/?)TITLE> } else {
613 <\/svg><\/svg><(\/?)TITLE> element = createElement('div', {
614 <\/svg><\/svg><(\/?)TITLE> className: 'highcharts-menu-item',
615 <\/svg><\/svg><(\/?)TITLE> onclick: function(e) {
616 <\/svg><\/svg><(\/?)TITLE> if (e) { // IE7
617 <\/svg><\/svg><(\/?)TITLE> e.stopPropagation();
618 <\/svg><\/svg><(\/?)TITLE> }
619 <\/svg><\/svg><(\/?)TITLE> hide();
620 <\/svg><\/svg><(\/?)TITLE> if (item.onclick) {
621 <\/svg><\/svg><(\/?)TITLE> item.onclick.apply(chart, arguments);
622 <\/svg><\/svg><(\/?)TITLE> }
623 <\/svg><\/svg><(\/?)TITLE> },
624 <\/svg><\/svg><(\/?)TITLE> innerHTML: item.text || chart.options.lang[item.textKey]
625 <\/svg><\/svg><(\/?)TITLE> }, null, innerMenu);
626  
627  
628 <\/svg><\/svg><(\/?)TITLE> element.onmouseover = function() {
629 <\/svg><\/svg><(\/?)TITLE> css(this, navOptions.menuItemHoverStyle);
630 <\/svg><\/svg><(\/?)TITLE> };
631 <\/svg><\/svg><(\/?)TITLE> element.onmouseout = function() {
632 <\/svg><\/svg><(\/?)TITLE> css(this, navOptions.menuItemStyle);
633 <\/svg><\/svg><(\/?)TITLE> };
634 <\/svg><\/svg><(\/?)TITLE> css(element, extend({
635 <\/svg><\/svg><(\/?)TITLE> cursor: 'pointer'
636 <\/svg><\/svg><(\/?)TITLE> }, navOptions.menuItemStyle));
637  
638 <\/svg><\/svg><(\/?)TITLE> }
639  
640 <\/svg><\/svg><(\/?)TITLE> // Keep references to menu divs to be able to destroy them
641 <\/svg><\/svg><(\/?)TITLE> chart.exportDivElements.push(element);
642 <\/svg><\/svg><(\/?)TITLE> }
643 <\/svg><\/svg><(\/?)TITLE> });
644  
645 <\/svg><\/svg><(\/?)TITLE> // Keep references to menu and innerMenu div to be able to destroy them
646 <\/svg><\/svg><(\/?)TITLE> chart.exportDivElements.push(innerMenu, menu);
647  
648 <\/svg><\/svg><(\/?)TITLE> chart.exportMenuWidth = menu.offsetWidth;
649 <\/svg><\/svg><(\/?)TITLE> chart.exportMenuHeight = menu.offsetHeight;
650 <\/svg><\/svg><(\/?)TITLE> }
651  
652 <\/svg><\/svg><(\/?)TITLE> menuStyle = {
653 <\/svg><\/svg><(\/?)TITLE> display: 'block'
654 <\/svg><\/svg><(\/?)TITLE> };
655  
656 <\/svg><\/svg><(\/?)TITLE> // if outside right, right align it
657 <\/svg><\/svg><(\/?)TITLE> if (x + chart.exportMenuWidth > chartWidth) {
658 <\/svg><\/svg><(\/?)TITLE> menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
659 <\/svg><\/svg><(\/?)TITLE> } else {
660 <\/svg><\/svg><(\/?)TITLE> menuStyle.left = (x - menuPadding) + 'px';
661 <\/svg><\/svg><(\/?)TITLE> }
662 <\/svg><\/svg><(\/?)TITLE> // if outside bottom, bottom align it
663 <\/svg><\/svg><(\/?)TITLE> if (y + height + chart.exportMenuHeight > chartHeight && button.alignOptions.verticalAlign !== 'top') {
664 <\/svg><\/svg><(\/?)TITLE> menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
665 <\/svg><\/svg><(\/?)TITLE> } else {
666 <\/svg><\/svg><(\/?)TITLE> menuStyle.top = (y + height - menuPadding) + 'px';
667 <\/svg><\/svg><(\/?)TITLE> }
668  
669 <\/svg><\/svg><(\/?)TITLE> css(menu, menuStyle);
670 <\/svg><\/svg><(\/?)TITLE> chart.openMenu = true;
671 <\/svg><\/svg><(\/?)TITLE> },
672  
673 <\/svg><\/svg><(\/?)TITLE> /**
674 <\/svg><\/svg><(\/?)TITLE> * Add the export button to the chart
675 <\/svg><\/svg><(\/?)TITLE> */
676 <\/svg><\/svg><(\/?)TITLE> addButton: function(options) {
677 <\/svg><\/svg><(\/?)TITLE> var chart = this,
678 <\/svg><\/svg><(\/?)TITLE> renderer = chart.renderer,
679 <\/svg><\/svg><(\/?)TITLE> btnOptions = merge(chart.options.navigation.buttonOptions, options),
680 <\/svg><\/svg><(\/?)TITLE> onclick = btnOptions.onclick,
681 <\/svg><\/svg><(\/?)TITLE> menuItems = btnOptions.menuItems,
682 <\/svg><\/svg><(\/?)TITLE> symbol,
683 <\/svg><\/svg><(\/?)TITLE> button,
684 <\/svg><\/svg><(\/?)TITLE> symbolSize = btnOptions.symbolSize || 12;
685 <\/svg><\/svg><(\/?)TITLE> if (!chart.btnCount) {
686 <\/svg><\/svg><(\/?)TITLE> chart.btnCount = 0;
687 <\/svg><\/svg><(\/?)TITLE> }
688  
689 <\/svg><\/svg><(\/?)TITLE> // Keeps references to the button elements
690 <\/svg><\/svg><(\/?)TITLE> if (!chart.exportDivElements) {
691 <\/svg><\/svg><(\/?)TITLE> chart.exportDivElements = [];
692 <\/svg><\/svg><(\/?)TITLE> chart.exportSVGElements = [];
693 <\/svg><\/svg><(\/?)TITLE> }
694  
695 <\/svg><\/svg><(\/?)TITLE> if (btnOptions.enabled === false) {
696 <\/svg><\/svg><(\/?)TITLE> return;
697 <\/svg><\/svg><(\/?)TITLE> }
698  
699  
700 <\/svg><\/svg><(\/?)TITLE> var attr = btnOptions.theme,
701 <\/svg><\/svg><(\/?)TITLE> states = attr.states,
702 <\/svg><\/svg><(\/?)TITLE> hover = states && states.hover,
703 <\/svg><\/svg><(\/?)TITLE> select = states && states.select,
704 <\/svg><\/svg><(\/?)TITLE> callback;
705  
706 <\/svg><\/svg><(\/?)TITLE> delete attr.states;
707  
708 <\/svg><\/svg><(\/?)TITLE> if (onclick) {
709 <\/svg><\/svg><(\/?)TITLE> callback = function(e) {
710 <\/svg><\/svg><(\/?)TITLE> e.stopPropagation();
711 <\/svg><\/svg><(\/?)TITLE> onclick.call(chart, e);
712 <\/svg><\/svg><(\/?)TITLE> };
713  
714 <\/svg><\/svg><(\/?)TITLE> } else if (menuItems) {
715 <\/svg><\/svg><(\/?)TITLE> callback = function() {
716 <\/svg><\/svg><(\/?)TITLE> chart.contextMenu(
717 <\/svg><\/svg><(\/?)TITLE> button.menuClassName,
718 <\/svg><\/svg><(\/?)TITLE> menuItems,
719 <\/svg><\/svg><(\/?)TITLE> button.translateX,
720 <\/svg><\/svg><(\/?)TITLE> button.translateY,
721 <\/svg><\/svg><(\/?)TITLE> button.width,
722 <\/svg><\/svg><(\/?)TITLE> button.height,
723 <\/svg><\/svg><(\/?)TITLE> button
724 <\/svg><\/svg><(\/?)TITLE> );
725 <\/svg><\/svg><(\/?)TITLE> button.setState(2);
726 <\/svg><\/svg><(\/?)TITLE> };
727 <\/svg><\/svg><(\/?)TITLE> }
728  
729  
730 <\/svg><\/svg><(\/?)TITLE> if (btnOptions.text && btnOptions.symbol) {
731 <\/svg><\/svg><(\/?)TITLE> attr.paddingLeft = pick(attr.paddingLeft, 25);
732  
733 <\/svg><\/svg><(\/?)TITLE> } else if (!btnOptions.text) {
734 <\/svg><\/svg><(\/?)TITLE> extend(attr, {
735 <\/svg><\/svg><(\/?)TITLE> width: btnOptions.width,
736 <\/svg><\/svg><(\/?)TITLE> height: btnOptions.height,
737 <\/svg><\/svg><(\/?)TITLE> padding: 0
738 <\/svg><\/svg><(\/?)TITLE> });
739 <\/svg><\/svg><(\/?)TITLE> }
740  
741 <\/svg><\/svg><(\/?)TITLE> button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select)
742 <\/svg><\/svg><(\/?)TITLE> .addClass(options.className)
743 <\/svg><\/svg><(\/?)TITLE> .attr({
744  
745 <\/svg><\/svg><(\/?)TITLE> 'stroke-linecap': 'round',
746  
747 <\/svg><\/svg><(\/?)TITLE> title: chart.options.lang[btnOptions._titleKey],
748 <\/svg><\/svg><(\/?)TITLE> zIndex: 3 // #4955
749 <\/svg><\/svg><(\/?)TITLE> });
750 <\/svg><\/svg><(\/?)TITLE> button.menuClassName = options.menuClassName || 'highcharts-menu-' + chart.btnCount++;
751  
752 <\/svg><\/svg><(\/?)TITLE> if (btnOptions.symbol) {
753 <\/svg><\/svg><(\/?)TITLE> symbol = renderer.symbol(
754 <\/svg><\/svg><(\/?)TITLE> btnOptions.symbol,
755 <\/svg><\/svg><(\/?)TITLE> btnOptions.symbolX - (symbolSize / 2),
756 <\/svg><\/svg><(\/?)TITLE> btnOptions.symbolY - (symbolSize / 2),
757 <\/svg><\/svg><(\/?)TITLE> symbolSize,
758 <\/svg><\/svg><(\/?)TITLE> symbolSize
759 <\/svg><\/svg><(\/?)TITLE> )
760 <\/svg><\/svg><(\/?)TITLE> .addClass('highcharts-button-symbol')
761 <\/svg><\/svg><(\/?)TITLE> .attr({
762 <\/svg><\/svg><(\/?)TITLE> zIndex: 1
763 <\/svg><\/svg><(\/?)TITLE> }).add(button);
764  
765  
766 <\/svg><\/svg><(\/?)TITLE> symbol.attr({
767 <\/svg><\/svg><(\/?)TITLE> stroke: btnOptions.symbolStroke,
768 <\/svg><\/svg><(\/?)TITLE> fill: btnOptions.symbolFill,
769 <\/svg><\/svg><(\/?)TITLE> 'stroke-width': btnOptions.symbolStrokeWidth || 1
770 <\/svg><\/svg><(\/?)TITLE> });
771  
772 <\/svg><\/svg><(\/?)TITLE> }
773  
774 <\/svg><\/svg><(\/?)TITLE> button.add()
775 <\/svg><\/svg><(\/?)TITLE> .align(extend(btnOptions, {
776 <\/svg><\/svg><(\/?)TITLE> width: button.width,
777 <\/svg><\/svg><(\/?)TITLE> x: pick(btnOptions.x, chart.buttonOffset) // #1654
778 <\/svg><\/svg><(\/?)TITLE> }), true, 'spacingBox');
779  
780 <\/svg><\/svg><(\/?)TITLE> chart.buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
781  
782 <\/svg><\/svg><(\/?)TITLE> chart.exportSVGElements.push(button, symbol);
783  
784 <\/svg><\/svg><(\/?)TITLE> },
785  
786 <\/svg><\/svg><(\/?)TITLE> /**
787 <\/svg><\/svg><(\/?)TITLE> * Destroy the buttons.
788 <\/svg><\/svg><(\/?)TITLE> */
789 <\/svg><\/svg><(\/?)TITLE> destroyExport: function(e) {
790 <\/svg><\/svg><(\/?)TITLE> var chart = e ? e.target : this,
791 <\/svg><\/svg><(\/?)TITLE> exportSVGElements = chart.exportSVGElements,
792 <\/svg><\/svg><(\/?)TITLE> exportDivElements = chart.exportDivElements,
793 <\/svg><\/svg><(\/?)TITLE> exportEvents = chart.exportEvents,
794 <\/svg><\/svg><(\/?)TITLE> cacheName;
795  
796 <\/svg><\/svg><(\/?)TITLE> // Destroy the extra buttons added
797 <\/svg><\/svg><(\/?)TITLE> if (exportSVGElements) {
798 <\/svg><\/svg><(\/?)TITLE> each(exportSVGElements, function(elem, i) {
799  
800 <\/svg><\/svg><(\/?)TITLE> // Destroy and null the svg/vml elements
801 <\/svg><\/svg><(\/?)TITLE> if (elem) { // #1822
802 <\/svg><\/svg><(\/?)TITLE> elem.onclick = elem.ontouchstart = null;
803 <\/svg><\/svg><(\/?)TITLE> cacheName = 'cache-' + elem.menuClassName;
804  
805 <\/svg><\/svg><(\/?)TITLE> if (chart[cacheName]) {
806 <\/svg><\/svg><(\/?)TITLE> delete chart[cacheName];
807 <\/svg><\/svg><(\/?)TITLE> }
808  
809 <\/svg><\/svg><(\/?)TITLE> chart.exportSVGElements[i] = elem.destroy();
810 <\/svg><\/svg><(\/?)TITLE> }
811 <\/svg><\/svg><(\/?)TITLE> });
812 <\/svg><\/svg><(\/?)TITLE> exportSVGElements.length = 0;
813 <\/svg><\/svg><(\/?)TITLE> }
814  
815 <\/svg><\/svg><(\/?)TITLE> // Destroy the divs for the menu
816 <\/svg><\/svg><(\/?)TITLE> if (exportDivElements) {
817 <\/svg><\/svg><(\/?)TITLE> each(exportDivElements, function(elem, i) {
818  
819 <\/svg><\/svg><(\/?)TITLE> // Remove the event handler
820 <\/svg><\/svg><(\/?)TITLE> clearTimeout(elem.hideTimer); // #5427
821 <\/svg><\/svg><(\/?)TITLE> removeEvent(elem, 'mouseleave');
822  
823 <\/svg><\/svg><(\/?)TITLE> // Remove inline events
824 <\/svg><\/svg><(\/?)TITLE> chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
825  
826 <\/svg><\/svg><(\/?)TITLE> // Destroy the div by moving to garbage bin
827 <\/svg><\/svg><(\/?)TITLE> discardElement(elem);
828 <\/svg><\/svg><(\/?)TITLE> });
829 <\/svg><\/svg><(\/?)TITLE> exportDivElements.length = 0;
830 <\/svg><\/svg><(\/?)TITLE> }
831  
832 <\/svg><\/svg><(\/?)TITLE> if (exportEvents) {
833 <\/svg><\/svg><(\/?)TITLE> each(exportEvents, function(unbind) {
834 <\/svg><\/svg><(\/?)TITLE> unbind();
835 <\/svg><\/svg><(\/?)TITLE> });
836 <\/svg><\/svg><(\/?)TITLE> exportEvents.length = 0;
837 <\/svg><\/svg><(\/?)TITLE> }
838 <\/svg><\/svg><(\/?)TITLE> }
839 <\/svg><\/svg><(\/?)TITLE> });
840  
841  
842  
843  
844 <\/svg><\/svg><(\/?)TITLE> symbols.menu = function(x, y, width, height) {
845 <\/svg><\/svg><(\/?)TITLE> var arr = [
846 <\/svg><\/svg><(\/?)TITLE> 'M', x, y + 2.5,
847 <\/svg><\/svg><(\/?)TITLE> 'L', x + width, y + 2.5,
848 <\/svg><\/svg><(\/?)TITLE> 'M', x, y + height / 2 + 0.5,
849 <\/svg><\/svg><(\/?)TITLE> 'L', x + width, y + height / 2 + 0.5,
850 <\/svg><\/svg><(\/?)TITLE> 'M', x, y + height - 1.5,
851 <\/svg><\/svg><(\/?)TITLE> 'L', x + width, y + height - 1.5
852 <\/svg><\/svg><(\/?)TITLE> ];
853 <\/svg><\/svg><(\/?)TITLE> return arr;
854 <\/svg><\/svg><(\/?)TITLE> };
855  
856 <\/svg><\/svg><(\/?)TITLE> // Add the buttons on chart load
857 <\/svg><\/svg><(\/?)TITLE> Chart.prototype.renderExporting = function() {
858 <\/svg><\/svg><(\/?)TITLE> var n,
859 <\/svg><\/svg><(\/?)TITLE> exportingOptions = this.options.exporting,
860 <\/svg><\/svg><(\/?)TITLE> buttons = exportingOptions.buttons,
861 <\/svg><\/svg><(\/?)TITLE> isDirty = this.isDirtyExporting || !this.exportSVGElements;
862  
863 <\/svg><\/svg><(\/?)TITLE> this.buttonOffset = 0;
864 <\/svg><\/svg><(\/?)TITLE> if (this.isDirtyExporting) {
865 <\/svg><\/svg><(\/?)TITLE> this.destroyExport();
866 <\/svg><\/svg><(\/?)TITLE> }
867  
868 <\/svg><\/svg><(\/?)TITLE> if (isDirty && exportingOptions.enabled !== false) {
869 <\/svg><\/svg><(\/?)TITLE> this.exportEvents = [];
870  
871 <\/svg><\/svg><(\/?)TITLE> for (n in buttons) {
872 <\/svg><\/svg><(\/?)TITLE> this.addButton(buttons[n]);
873 <\/svg><\/svg><(\/?)TITLE> }
874  
875 <\/svg><\/svg><(\/?)TITLE> this.isDirtyExporting = false;
876 <\/svg><\/svg><(\/?)TITLE> }
877  
878 <\/svg><\/svg><(\/?)TITLE> // Destroy the export elements at chart destroy
879 <\/svg><\/svg><(\/?)TITLE> addEvent(this, 'destroy', this.destroyExport);
880 <\/svg><\/svg><(\/?)TITLE> };
881  
882 <\/svg><\/svg><(\/?)TITLE> Chart.prototype.callbacks.push(function(chart) {
883  
884 <\/svg><\/svg><(\/?)TITLE> function update(prop, options, redraw) {
885 <\/svg><\/svg><(\/?)TITLE> chart.isDirtyExporting = true;
886 <\/svg><\/svg><(\/?)TITLE> merge(true, chart.options[prop], options);
887 <\/svg><\/svg><(\/?)TITLE> if (pick(redraw, true)) {
888 <\/svg><\/svg><(\/?)TITLE> chart.redraw();
889 <\/svg><\/svg><(\/?)TITLE> }
890  
891 <\/svg><\/svg><(\/?)TITLE> }
892  
893 <\/svg><\/svg><(\/?)TITLE> chart.renderExporting();
894  
895 <\/svg><\/svg><(\/?)TITLE> addEvent(chart, 'redraw', chart.renderExporting);
896  
897 <\/svg><\/svg><(\/?)TITLE> // Add update methods to handle chart.update and chart.exporting.update
898 <\/svg><\/svg><(\/?)TITLE> // and chart.navigation.update.
899 <\/svg><\/svg><(\/?)TITLE> each(['exporting', 'navigation'], function(prop) {
900 <\/svg><\/svg><(\/?)TITLE> chart[prop] = {
901 <\/svg><\/svg><(\/?)TITLE> update: function(options, redraw) {
902 <\/svg><\/svg><(\/?)TITLE> update(prop, options, redraw);
903 <\/svg><\/svg><(\/?)TITLE> }
904 <\/svg><\/svg><(\/?)TITLE> };
905 <\/svg><\/svg><(\/?)TITLE> });
906  
907 <\/svg><\/svg><(\/?)TITLE> // Uncomment this to see a button directly below the chart, for quick
908 <\/svg><\/svg><(\/?)TITLE> // testing of export
909 <\/svg><\/svg><(\/?)TITLE> /*
910 <\/svg><\/svg><(\/?)TITLE> if (!chart.renderer.forExport) {
911 <\/svg><\/svg><(\/?)TITLE> var button = doc.createElement('button');
912 <\/svg><\/svg><(\/?)TITLE> button.innerHTML = 'View exported SVG';
913 <\/svg><\/svg><(\/?)TITLE> chart.renderTo.parentNode.appendChild(button);
914 <\/svg><\/svg><(\/?)TITLE> button.onclick = function () {
915 <\/svg><\/svg><(\/?)TITLE> var div = doc.createElement('div');
916 <\/svg><\/svg><(\/?)TITLE> div.innerHTML = chart.getSVGForExport();
917 <\/svg><\/svg><(\/?)TITLE> chart.renderTo.parentNode.appendChild(div);
918 <\/svg><\/svg><(\/?)TITLE> };
919 <\/svg><\/svg><(\/?)TITLE> }
920 <\/svg><\/svg><(\/?)TITLE> // */
921 <\/svg><\/svg><(\/?)TITLE> });
922  
923 <\/svg><\/svg><(\/?)TITLE> }(Highcharts));
924 <\/svg><\/svg><(\/?)TITLE>}));