DateTime Increment : Possible to force increment setting ?
Posted: Fri Dec 09, 2005 11:02 am
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
}
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
}