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. Image for the cookie policy date

Can''t set font size of legend

Hi,

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: 10.1.0.44

Thanks


3 Replies

SD Sivakumar D Syncfusion Team 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.

http://www.syncfusion.com/downloads/Support/DirectTrac/General/F102913-1513671456.zip

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.

Regards,
Siva




MM Matthias Max 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!



SD Sivakumar D Syncfusion Team 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.

[C#]

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


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

http://help.syncfusion.com/Ug_101/User%20interface/Windows%20Forms/Chart/Documents/customizinglegenditemimage1.htm

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

http://www.syncfusion.com/downloads/Support/DirectTrac/General/F102913-15136714561486720867.zip

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

Regards,
Siva



Loader.
Live Chat Icon For mobile
Up arrow icon