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

How to set chart legend font?

I have found the font property for the chart, primaryX and primaryY axes. I cannot find one for the legend! Is there one and where do I set it? If not, how can I make my legend have the same font as the rest of my chart at runtime? Also, I want the title of my chart to be large and bold without affecting the rest of the text (primary axes and legend). How can I do this?

3 Replies

Davis Jebaraj November 29, 2004 08:44 PM UTC

Hi, Please refer to the sample linked to below for an example of changing the Legend Font and the Chart Title Font: http://www.syncfusion.com/support/user/uploads/f21922chartlegendfont.zip C# Code: private void Form1_Load(object sender, System.EventArgs e) { InitializeChartData(); this.chartControl1.Legend.FilterItems += new LegendFilterItemsEventHandler(this.FilterLegend); this.chartControl1.Font = new Font("Times New Roman" , 24.0f); } protected void FilterLegend(object sender, ChartLegendFilterItemsEventArgs args) { int legendCount = args.Items.Length; for(int i =0; i

Administrator November 30, 2004 11:28 AM UTC

Thanks Davis, that works for me. Now, how can I do the same for the labels on the primary X and Y axes? How about the labels for each point in the series?

Davis Jebaraj December 1, 2004 06:28 PM UTC

Hi, I have modified the sample to change the point fonts and the axes fonts: f21922ChartLegendFontRev1_9418.zip Regards, Davis
Live Chat Icon For mobile
Up arrow icon