Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# .net图表x轴值不显示在列下_C#_.net_Asp.net Mvc - Fatal编程技术网

C# .net图表x轴值不显示在列下

C# .net图表x轴值不显示在列下,c#,.net,asp.net-mvc,C#,.net,Asp.net Mvc,对于下面的代码 foreach (LeaveType lvType in statsForBP.LeavesPerType.Keys) { var series = new Series(); series.Points.AddXY(lvType.TypeofLeave.ToString(),statsForBP.LeavesPerType[lvType]); series.SmartLabelStyle.E

对于下面的代码

 foreach (LeaveType lvType in statsForBP.LeavesPerType.Keys)
        {
           var series = new Series();
            series.Points.AddXY(lvType.TypeofLeave.ToString(),statsForBP.LeavesPerType[lvType]);
            series.SmartLabelStyle.Enabled = false;

            chart.Series.Add(series);
        }
我得到以下结果


您知道如何将x值直接置于下方吗?

尝试单独创建一个数据点并添加AxisLabel,如下所示:

DataPoint dpValue = new DataPoint();
dpValue.SetValueY(value);
dpValue.AxisLabel = "Label";

没有骰子。同样的结果。