How to set values in x axis MSChart using C#

后端 未结 2 1044
一向
一向 2020-12-09 22:14

I have these XY values:

Series S1 = new Series()
S1.Points.AddXY(9, 25);
S1.Points.AddXY(10, 35);
S1.Points.AddXY(11, 15);
chart1.Series.Add(S1);
         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 22:46

    Curious as to why your range array was sprawled out like that. It would have been cleaner to put your array in brackets as it was defined and also initialized. e.g.

    string[] range = new string[10] {"","7-8","8-9","9-10","10-11","11-12","12-1","1-2","2-3",""};
    /*
      The tenth element is also likely unnecessary 
      as it simply repeats the first     
      element of the array
    */
    

提交回复
热议问题