c# winform Chart Pie 中若X轴数据为字符串时,#VALX取值为0

https://q.cnblogs.com/q/83848/

在winform程序中用自带的Chart进行画图表时,若画饼图,其中X轴数据为字符串,这时候如果想设置Label值的格式为#VALX:#VAL,在图中显示的总是0:y值,或者图例中也为0,这时候就要显示定义X轴类型

ct.Series["Series2"].XValueType = ChartValueType.String;
ct.Series["Series2"].Label = "#VALX:#VAL人";

这样就解决了

原文地址:https://www.cnblogs.com/Betty-IT/p/9226285.html