Completed
Last Updated: 02 Jun 2021 13:33 by ADMIN
Ricardo
Created on: 31 Jan 2019 23:22
Category: Charts
Type: Feature Request
0
Add height and width to ChartComponent exportSVG method

Request to allow control of SVG dimensions from exportSVG options

 

Ideal behavior:

 

export class AppComponent {

@ViewChild('chart')
private chart: ChartComponent;
public seriesData: number[] = [1, 2, 3, 5];
public exportChart(): void {
this.chart.exportSVG({ width: 600, height: 300 }).then((dataURI) => {
saveAs(dataURI, 'chart.svg');
});
}
}

 

this should produce a 600x300 svg. ChartComponent.prototype.exportSVG does not pass options into ChartComponent.prototype.exportVisual in the kendo-angular-charts library. I request that it pass these options in to allow for SVG dimension specification. I have modified the code manually and it behaves as expected.

2 comments
ADMIN
Svet
Posted on: 02 Jun 2021 13:33

This request has been implemented for the exportSVG() method:

https://www.telerik.com/kendo-angular-ui/components/charts/api/ChartComponent/#toc-exportsvg

Regards,
Svetlin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
T. Tsonev
Posted on: 05 Feb 2019 12:42
Hi Ricardo,

Good suggestion, thanks. In the meantime you can use the exportVisual method to set the size, see runnable example.
public exportChart(): void {
   const visual = this.chart.exportVisual({ width: 600, height: 300 });
   exportSVG(visual).then(dataURI => {
   saveAs(dataURI, 'chart.svg');
});


We'll update the documentation to list all supported options.

Best Regards,
T. Tsonev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.