winform livecharts柱状图 柱子上显示Y值
在Series 中加上DataLabels = true
// 图表显示
cartesianChart1.Series = new SeriesCollection
{
new ColumnSeries
{
Title = "个数",
DataLabels = true,
Values = new ChartValues<double> { 10, 50, 39, 50 },
}
};
cartesianChart1.AxisX.Add(new Axis
{
Title = "缺陷类型",
Labels = new[] { "Dent", "Scratch", "ZW", "CS" },
Separator = new Separator { Step = 1 },
});
cartesianChart1.AxisY.Add(new Axis
{
Title = "个",
LabelFormatter = value => value.ToString("N")
});