Reputation: 494
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 :
It seems a simple question but i can't find the way to solve this problem. Can anyone help me ?
Thanks in advance.
Upvotes: 1
Views: 4204
Reputation: 924
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;
Upvotes: 2
Reputation: 57210
As far as I know, the only way to do this is by setting the interval property of the axis.LabelStyle
e.g.:
this.chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 0.1;
For example, setting 0.1 in a logaritmic scale, the labels show will be 10^0.1
, 10^0.2
, 10^0.3
...
If you need something more particular, I suggest you to create the labels manually using the property axis.CustomLabels
, even if is not so intuitive...
Upvotes: 0