Asp柱形图,如何在列的左侧打勾而不是居中?

时间:2015-01-01 05:46:12

标签: c# css asp.net charts

我花了好几个小时试图解决这个愚蠢的问题。我用asp图表控件创建一个直方图。我想要做的就是在列的左侧有xaxis标签,而不是在它的中心。 Xaxis lable似乎没有像系列那样的位置属性,所以我无法理解它并且令人沮丧。

这是一个示例代码,向您展示我的内容:

        private void Graphique()
    {
        // Creating the series 
        Series series2 = new Series("Series2");

        // Setting the Chart Types
        series2.ChartType = SeriesChartType.Column;

        // Adding some points
        series2.Points.AddXY(1492, 12);
        series2.Points.AddXY(2984, 0);
        series2.Points.AddXY(4476, 1);
        series2.Points.AddXY(5968, 2);
        series2.Points.AddXY(7460, 2);
        series2.Points.AddXY(8952, 12);
        series2.Points.AddXY(10444, 4);
        series2.Points.AddXY(11936, 3);
        series2.Points.AddXY(13428, 3);
        series2.Points.AddXY(14920, 5);
        series2.Points.AddXY(16412, 1);

        Chart3.Series.Add(series2);

        Chart3.Width = 600;
        Chart3.Height = 600;

        // Series visual
        series2.YValueMembers = "Frequency";
        series2.XValueMember = "RoundedValue";
        series2.BorderWidth = 1;
        series2.ShadowOffset = 0;
        series2.IsXValueIndexed = true;

        // Setting the X Axis
        Chart3.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = true;
        Chart3.ChartAreas["ChartArea1"].AxisX.Interval = 1;
        Chart3.ChartAreas["ChartArea1"].AxisX.Maximum = Double.NaN;
        Chart3.ChartAreas["ChartArea1"].AxisX.Title = "kbps";

        // Setting the Y Axis
        Chart3.ChartAreas["ChartArea1"].AxisY.Interval = 2;
        Chart3.ChartAreas["ChartArea1"].AxisY.Maximum = Double.NaN;
        Chart3.ChartAreas["ChartArea1"].AxisY.Title = "Frequency";
    }

现在,我的真实图表如下所示:Actual result

我想要与此网站类似的内容: Desired layout chart

你看,x标签位于左侧,考虑到直方图的每一列代表一系列值的频率,这更有意义.......

任何帮助将不胜感激......

0 个答案:

没有答案