我想在 asp.net 图表的条形顶部显示值。我还想在显示 x 轴时隐藏它。对于模型,请参见下图。谢谢。
我尝试了以下但不起作用。
var c = HorizontalChart;
//c.ChartAreas.Add(new ChartArea("HChartArea"));
//c.ChartAreas[0].BackHatchStyle = ChartHatchStyle.None;
c.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
c.ChartAreas[0].AxisY.MajorGrid.Enabled = false;
c.ChartAreas[0].AxisY.CustomLabels="Code here for Lable values" <-------------
c.Width = 300;
c.Height = 300;
Series myHorizontalSeries = new Series();
myHorizontalSeries.Color = System.Drawing.Color.Blue;
myHorizontalSeries.ChartType = SeriesChartType.Bar;
myHorizontalSeries.Points.DataBindXY(new string[] { "one", "two", "three" }, new int[] { 1, 2, 3 });
c.Series.Add(myHorizontalSeries);