New
Last Updated: 05 Feb 2019 12:42 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.

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
1 comment
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.