This is a migrated thread and some comments may be shown as answers.

Change font-size on chart on all texts

3 Answers 451 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Dan asked on 19 Apr 2021, 12:44 PM

I have a requirement to print a chart. The chart should be displayed in a small area and I need to modify the font-size on all texts. I have found that you could use the text { font-size: 8px !important; } but this one is ignored when I do the actual printing (The printing is done using the teletik printion on pdf)

How can I decrease all the texts in a chart or change the default sizing?

3 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 22 Apr 2021, 10:05 AM

Hello Dan,

The reason for this behavior comes from the fact that the Chart and the PDF Export are using different fonts. A possible solution to overcome this behavior is to change the font of the chart labels:

.Legend(legend => legend
            .Labels(l => l.Font("14px DejaVu Sans"))
        )

Here is a small Dojo demo demonstrating this: https://dojo.telerik.com/OTaNaQOc

Let me know if this helps.

Regards,
Nikolay
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 22 Apr 2021, 10:30 AM

Hi Nicolay,

Thank you for the answer. But now I have another question. I saw that you provided as an example the font "DejaVu Sans" and I saw other posts about this font and the printing to pdf. My question is should I use this font on the chart  or can I use other fonts like "Arial", "Helvetica" or "sans-serif"?

0
Nikolay
Telerik team
answered on 27 Apr 2021, 09:20 AM

Hello Dan,

You can use other fonts as well. There is a good documentation article on this topic I am posting below:

Let me know if you have any questions.

Regards,
Nikolay
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/.

Tags
Chart
Asked by
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Nikolay
Telerik team
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or