Page 1 of 1
Double Logarithmic and other Axis
Posted: Wed Dec 01, 2004 11:16 am
by 8127604
Hi,
for one of our customers I have to programm different views of his series. The Axis must in one case be double logarithmic, and in another it has to follow a delicate formula to calculate the steps and increments.
Is there any way to do this?
If there is no other possibility I can transform the Values to display in the desired Form, but in this case the Axis Labels will not display the correct values.
Is there any possibility to "correct" the Labels?
Best regards,
Pekai
Posted: Wed Dec 01, 2004 11:56 am
by narcis
Hi Pekai,
Axis are fully customizable. You can set the increments you need. You can also set the minimum and maximum values as other arguments.
You can also only show the labels you want using custom axis labels. There is an example of this at the TeeChart for .NET demo which comes with the installer and can found at the Start Menu\Programs\ TeeChart folder. The example to search for is called "custom labels"
Increment and Min, Max is not enough
Posted: Wed Dec 01, 2004 12:14 pm
by 8127604
Hi,
thanks for the answer, but I think Min/Max and an increment ist not enough. The "Increment" is different for every step. The axis values must be completely set by a complex formula.
It would be nice to inherit from the axis class and to override the CalcYPosValue or CalcXPosValue. But they are not virtual.
Anybody an solution for this?
Posted: Mon Dec 06, 2004 10:40 am
by Marjan
Hi.
Using custom axis labels you can calculate desired axis increments and (visible) labels and then pass them to chart axis. The following code demonstrates how to add custom axis labels to log-axis:
Code: Select all
tChart1.Axes.Left.Logarithmic = true;
tChart1.Axes.Left.SetMinMax(0.1,10);
Steema.TeeChart.AxisLabels labels = tChart1.Axes.Left.Labels;
labels.Items.Clear();
// decade 1e-1 to 1e+0
labels.Items.Add(0.1);
labels.Items.Add(0.2);
labels.Items.Add(0.3);
labels.Items.Add(0.45);
labels.Items.Add(0.6);
labels.Items.Add(0.75);
// decade 1e+0 to 1e+1
labels.Items.Add(1.0);
labels.Items.Add(2.0);
labels.Items.Add(3.0);
labels.Items.Add(4.5);
labels.Items.Add(6.0);
labels.Items.Add(7.5);
labels.Items.Add(10.0);
Of course, this is only an example, you can use much more complex code to calculate custom axis increments (for each step) and axis labels you want to display (based on axis minimum and maximum value). The big advantage of this approach is you can fully customize increment(s) and axis labels.