@progress/kendo-charts 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -288,6 +288,9 @@ var Chart = (function (Class) {
288
288
  this.surface.clear();
289
289
  this.surface.resize();
290
290
  }
291
+
292
+ // Override the surface _kendoExportVisual in order to accept export options with size.
293
+ this.element._kendoExportVisual = this._kendoExportVisual.bind(this);
291
294
  };
292
295
 
293
296
  Chart.prototype._surfaceWrap = function _surfaceWrap () {
@@ -368,6 +371,20 @@ var Chart = (function (Class) {
368
371
  }
369
372
  };
370
373
 
374
+ Chart.prototype._kendoExportVisual = function _kendoExportVisual (size) {
375
+ if (size && size.width && size.height) {
376
+ var chartArea = this._originalOptions.chartArea || {};
377
+ var exportOptions = {
378
+ width: chartArea.width || size.width,
379
+ height: chartArea.height || size.height
380
+ };
381
+
382
+ return this.exportVisual(exportOptions);
383
+ }
384
+
385
+ return this.exportVisual();
386
+ };
387
+
371
388
  Chart.prototype.exportVisual = function exportVisual (exportOptions) {
372
389
  var visual;
373
390
  if (exportOptions && (exportOptions.width || exportOptions.height || exportOptions.options)) {
@@ -279,6 +279,9 @@ class Chart extends Class {
279
279
  this.surface.clear();
280
280
  this.surface.resize();
281
281
  }
282
+
283
+ // Override the surface _kendoExportVisual in order to accept export options with size.
284
+ this.element._kendoExportVisual = this._kendoExportVisual.bind(this);
282
285
  }
283
286
 
284
287
  _surfaceWrap() {
@@ -356,6 +359,20 @@ class Chart extends Class {
356
359
  }
357
360
  }
358
361
 
362
+ _kendoExportVisual(size) {
363
+ if (size && size.width && size.height) {
364
+ const chartArea = this._originalOptions.chartArea || {};
365
+ const exportOptions = {
366
+ width: chartArea.width || size.width,
367
+ height: chartArea.height || size.height
368
+ };
369
+
370
+ return this.exportVisual(exportOptions);
371
+ }
372
+
373
+ return this.exportVisual();
374
+ }
375
+
359
376
  exportVisual(exportOptions) {
360
377
  let visual;
361
378
  if (exportOptions && (exportOptions.width || exportOptions.height || exportOptions.options)) {