سؤال

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.

هل كانت مفيدة؟

المحلول

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;

نصائح أخرى

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...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top