We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can''t set font size of legend

Thread ID:





102913 Mar 13,2012 01:24 PM UTC Mar 19,2012 05:21 AM UTC ASP.NET Web Forms (Classic) 3
Tags: Chart
Matthias Max
Asked On March 13, 2012 01:24 PM UTC


I'm setting the font size of the legend like this:
cwcChart.Legend.Font.Name = "Sans-Serif"
cwcChart.Legend.Font.Size = New FontUnit(10, UnitType.Pixel)

The size will not be recognized by the chart though. Also when I don't set the size at all the value is "8pt" but its definitely much bigger than 8pt in the chart picture in the browser.

Is this a known bug?

My version:


Sivakumar D [Syncfusion]
Replied On March 14, 2012 04:33 AM UTC

Hi Matthias,

Thanks for using Syncfusion products.

We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple sample for Chart Legend Font. The sample can be downloaded from the following link.


Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.

Please let us know if any concerns.


Matthias Max
Replied On March 15, 2012 05:52 PM UTC

HI, thanks for the reply. This works for me.

For some reason though, in my case the Font is way bigger then 10px. I tried to set it now to 8 px for a test. It then gets smaller like around the size in your example. I have to put 8 px though to make it work with this workaround. What aspects may lead to this behaviour?

Another question: How can I change the Icon of the legends to "straightline" for the seris without using custom icons?

Thakn you!

Sivakumar D [Syncfusion]
Replied On March 19, 2012 05:21 AM UTC

Hi Matthias,

Thanks for your update.

We deeply regret for inconvenience caused.

We are unable to reproduce the issue which was mentioned by you in the last response of this forum(legend font size not working properly in some cases).

We suggest you to use RepresentationType property of legend to customize the icon displayed in the legend.It Specifies how each legend item should be represented. Please refer below code snippet.


this.ChartWebControl1.Legend.RepresentationType = ChartLegendRepresentationType.StraightLine;

For more information about customizing legend item image, Please refer our online documentation link given below.


For your convenience, we have modified the sample and the same can be downloaded from the following link.


Please let me know if you have any other questions or concerns.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon