Set the text of the MS Chart Control for. Net pie chart legend

Source: Internet
Author: User

In the previous article, we mentioned how to use keyword to set the Label display format on the pie chart, for example:

Chart1.series [0]. Label = "# Valy [# percent]";

At this time, the label is displayed as the size of the Y axis value, and the percentage is displayed in the brackets that follow it.

In practice, I found that, without formatting, the corresponding name of the X axis is displayed by default in the legend. However, once this setting is made, the legend shows the same value as the label. This is obviously not the result I want. However, text is not found in the legend attribute. Only title and name are available. title is used to set the title of the legend, and name is used to specify its name.

Later, a legendtext attribute is found in series to meet the requirements. The settings are as follows:

Chart1.series [0]. legendtext = "# valx ";

A keyword is also used to set it as the corresponding value of the X axis.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.