Search code examples
c#winformsmschartmicrosoft-chart-controls

How to display logarithmic x-axis minor label?


I set x-axis as logarithmic scale, but it only displays the major labels, exp : 1E000, 1E001, 1E002, etc... Now i also want to display the minor values, for example : 2E000, 3E000, 4E000,..., 2E001, 3E001, .....

it should look like the graph below : enter image description here

It seems a simple question but i can't find the way to solve this problem. Can anyone help me ?

Thanks in advance.


Solution

  • This question is similar to this one.

    It took me a long time to solve this one, but:

    If you if you set the MinorGrid Interval to 1, then you get the traditional Logarithmic grid marks, ten per decade:

    aChart.ChartAreas[0].AxisX.IsLogarithmic = true;
    aChart.ChartAreas[0].AxisX.MinorGrid.Interval = 1;
    aChart.ChartAreas[0].AxisX.MinorGrid.Enabled = true;