Search code examples
javascriptsyncfusionej2-syncfusion

Syncfusion JavaScript (ES5) Export Chart with Custom Font Family


I have a custom font from google fonts. This font family, defined everywhere in the chart.

titleStyle.fontFamily, subTitleStyle.fontFamily, primaryXAxis.titleStyle.fontFamily etc.

I am exporting the chart like this: chart.export('PNG','filename');

But the chart did not exported with my custom font.

I am looking for an in-build functionality to define the font family of the chart once, or exporting the chart with a custom font family.

Thank you.

PS: Canvas rendering, is not a solution for my problem. I need the same export functionality for AccumulationChart too.


Solution

  • We have specified different font family for chart title, subtitle and primary x axis title. We were able to export chart with mentioned font family. We have attached the sample and exported image for your reference.

    Sample : https://stackblitz.com/edit/udq6wm

    Screenshot :

    Export Chart