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.
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
eg:
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...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.