Page 1 of 1
Overlapped Axis Labels in Log Scale
Posted: Tue Nov 08, 2011 6:56 am
by 15660495
Hi, there.
I got a problem with the following code:
Code: Select all
Line line = new Line();
double max = 1E303;
tChart1.Axes.Left.Automatic = false;
tChart1.Axes.Left.Minimum = 0;
tChart1.Axes.Left.Maximum = max;
tChart1.Axes.Left.Logarithmic = true;
tChart1.Axes.Left.LogarithmicBase = 10;
tChart1.Axes.Left.Labels.ValueFormat = "0.00#E+00";
int step = 100;
double interval = max / step;
for (int i = 0; i < step; i++)
{
line.Add((double)(i * 10), (double)(i * interval));
}
tChart1.Series.Add(line);
The problem is that the labels are overlapped on rendered chart while I expect the overlapped labels can be skipped. Any idea? Thanks a lot.
Re: Overlapped Axis Labels in Log Scale
Posted: Tue Nov 08, 2011 12:52 pm
by 10050769
Hello eidola,
I think your problem is that the scale of your axes are not correct. Please see next code and tell us if it works as you expected or you need it do something special?
Code: Select all
private void InitializeChart()
{
Line line = new Line();
tChart1.Aspect.View3D = false;
double max = 1E303;
tChart1.Axes.Left.Logarithmic = true;
tChart1.Axes.Left.LogarithmicBase = 10;
tChart1.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series;
tChart1.Axes.Left.Labels.ValueFormat = "0.00#E+00";
int step = 100;
double interval = max / step;
for (int i = 1; i < step; i++)
{
line.Add((double)(i * 10), (double)(i * interval));
}
tChart1.Series.Add(line);
tChart1.Axes.Left.Minimum = interval;
tChart1.Axes.Left.Maximum = max;
}
I hope will helps.
Thanks,
Re: Overlapped Axis Labels in Log Scale
Posted: Wed Nov 09, 2011 1:17 am
by 15660495
Hi, Sandra,
First of all, thanks for your reply. Actually I expect something else.
I noticed the data range on Y axis has been changed in your sample. But unfortunately for my case, the data range is from 0 ~ 1E+303. If I set back the data range, you sample code result will be like this:
[img]Screenshot.png[/img]
If I am not wrong, there are 303 labels rendered on Y axis but I hoped it can be less. To avoid overlapping, is there a way to hide some labels on Y axis?
Re: Overlapped Axis Labels in Log Scale
Posted: Wed Nov 09, 2011 12:09 pm
by 10050769
Hello eidola,
You are right. In this case, I think that would be useful for you, take a look in the Demo Project, concretely in All Features\Welcome !\Axes\Labels\Custom logarithmic axis where you can find how do to setup custom logarithmic increment.
I hope will helps.
Thanks,