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

Custom ChartPie

Thread ID:





116908 Jun 29,2014 09:38 AM UTC Jun 30,2014 09:22 AM UTC ASP.NET MVC (Classic) 1
Tags: Chart
Jesus Sanchez
Asked On June 29, 2014 09:38 AM UTC

I am using ASP.net MVC Classic fon my graphics, then: mi ChartPie with data:

Now, my ChartPie without data:

How can I customize my graph ChartPie?? ...

I want to remove the description: 'Empty' and put a different one, my description. Too I would like to further this description to use another font and to central it on the page, can you help me???


Anandaraj T [Syncfusion]
Replied On June 30, 2014 09:22 AM UTC

Hi Jesus Sanchez,

Thanks for using Syncfusion products.

The text "Empty" will be displayed if chart does not have any legend item. We can customize this text and its font by adding a custom legend item if number of legend item in chart legend is zero.

Please refer the following code snippet to achieve this.
            //Displaying text instead of displaying empty
            if (model.Legend.Items.Length == 0)
                model.Legend.CustomItems = new ChartLegendItem[]{new ChartLegendItem("Custom Text")};
                //Hiding legend item representation icon
                model.Legend.CustomItems[0].RepresentationSize = new Size(0, 0);
                //Setting font for text
                model.Legend.CustomItems[0].Font = new Font("Segoe UI", 12, FontStyle.Bold);
                //Customizing alignment of legend text
                model.Legend.TextAlignment = StringAlignment.Near;

We have also created a simple sample based on your requirement and it can be downloaded from the following link.

Please let us know if you have any concern.



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