none
How to set X axis is logarithmic

    Question

  • When I set the X axis IsLogarithmic is true,there will come a error,it say Chart Area Axex--A logarithmic scale cannot be use for this axis.If I want X axis is logarithmic ,how to do it ?thanks for you help
    Monday, June 15, 2009 8:33 AM

Answers

All replies

  • This exception is raised if you do not provide X xalues for the data points or Series.IsXValueIndexed is set tot True. In both scenariou logarithmic scale is not supported.

    Alex.
    http://blogs.msdn.com/alexgor
    Monday, June 15, 2009 3:07 PM
  • 你应该也是中国人吧。。。我也遇到了相似的问题,在代码中合适位置加入2句话应该就好了:

                chart1.ChartAreas["ChartArea1"].AxisX.IsLogarithmic = true;
                chart1.ChartAreas["ChartArea1"].AxisX.IsStartedFromZero = false;//大部分错误可能就是因为没加这句话

    为了好看起见,可以再加入适当的间隔,比如:

                chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Interval = 5;
                chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;

    • Proposed as answer by aaqqxx1910 Wednesday, September 01, 2010 12:22 PM
    Wednesday, September 01, 2010 12:21 PM