Page 1 of 1

DateTime Increment : Possible to force increment setting ?

Posted: Fri Dec 09, 2005 11:02 am
by 9087252
Hi,

I have a problem with the datetime increment setting. When setting the increment to "OneDay", the chart will automaticly change the increment to "OneWeek" when displaying the chart due to the fact that TeeChart avoids label overlapping.

See help text :
"When changing axis label frequency, bear in mind that TeeChart will avoid label overlap according to the setting of the AxisLabels.Separation property. This means that if the label frequency is too high for the labels to fit, then TeeChart will allocate 'best fit'. Changing the label angle and label separation are 2 options that may help you fit the labels you require. See the Labels section and AxisLabels.Angle property."

"Axis Increment is the minimum step between axis labels. It must be a positive number or DateTime value. TChart will use this value as the starting axis labels step. If there is not enough space for all labels, TChart will calculate a bigger one. You can use the DateTimeStep constant array for DateTime increments."

Now I want the labels to overlap when there is not enough space for all labels. How can I force the labels to overlap ?
The help text also states that the Teechart will calculate a bigger one, but its not the first 'bigger one' that fits!

In my case I have set the increment to "OneDay".
The first increment type that fits = '5 days'
TeeChart chooses OneWeek as 'Best Fit' increment type.

CodeSnippet:
tChart2.Axes.Bottom.Labels.Separation = 0;
tChart2.Axes.Bottom.Automatic = false;
switch(xIncrementParam.ToUpper())
{
case "ONEDAY" :
tChart2.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.OneDay];
break;
case "TWODAY" :
tChart2.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.TwoDays];
break;
case "FIVEDAY" :
tChart2.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.TwoDays];
tChart2.Axes.Bottom.Increment = 5;
break;
case "ONEMONTH" :
tChart2.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.OneMonth];
break;
default :
tChart2.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep[(int)Steema.TeeChart.DateTimeSteps.OneWeek];
break;


Kind regards,
Erwin
}

Posted: Mon Dec 12, 2005 4:00 pm
by narcis
Hi Erwin,

You can force this overlapping by setting label separation to zero:

Code: Select all

	tChart1.Axes.Bottom.Labels.Separation=0;

Posted: Tue Dec 13, 2005 8:31 am
by 9087252
Hi,

I have set the separation property to 0, but it has no effect. (See code in my previous post)

Are there any other properties that have to be set?

Kind regards,
Erwin

Posted: Tue Dec 13, 2005 12:43 pm
by narcis
Hi Erwin,

I've checked that, even if setting labels separation to 0, labels overlapping is not allowed. I'll add your request to our wish-list to be considered for future releases.