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.