none
c# chart 柱形图占满一天 RRS feed

  • 问题

  • please verify my account



    如图:柱形图的宽度应该占满11-12一天的宽度,但是只占了一小块,我调节柱形图的宽度,他也不能正好占满指定的宽度,应该怎么修改?
    • 已编辑 lctk 2018年1月22日 7:42
    2018年1月22日 7:40

答案

  • Hi,

    欢迎在MSDN论坛发帖。

    我这边做出测试,并没有重现你这个问题,都是在正中间的,你可以参考我的代码来加以修改。

     List<int> array1 = new List<int> { 2, 8, 6, 4, 5, 4, 6, 7 };
                List<int> array2 = new List<int> { 2, 4, 6, 3, 8, 1, 9, 7 };
    
                Series series1 = new Series();
                series1.Name = "MySeries1";
                chart3.Series.Add(series1);
    
                Series series2 = new Series();
                series2.Name = "MySeries2";
                chart3.Series.Add(series2);
    
                for (int i = 0; i < 7; i++)
                {
                    chart3.Series["MySeries1"].Points.AddXY(i + 2011, array1[i]);
                    chart3.Series["MySeries2"].Points.AddXY(i + 2011, array2[i]);
                }

    Best Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2018年1月24日 2:06
    版主