Page 1 of 1

Repeated dates shown when time scale is set to less than 11

Posted: Tue Nov 22, 2011 2:19 pm
by 13051459
Hi

We have used teeChart for .netv3 for displaying graphs. The X-axis is the date time value.
The user can customized the scale of date time to any values in hours.
With our current implementation, for any value less than 11hrs, the graph is distorted and the values in timecsale are repeated.
[It even happend on zomming in feature]
We are using teeChart.Chart.Axes.Bottom.SetMinMax(minDateTime, maxDateTime);
it works fine if the difference between max and min is greater than 11hrs.

Any help would be appreciated.

Thanks

Re: Repeated dates shown when time scale is set to less than 11

Posted: Tue Nov 22, 2011 2:48 pm
by narcis
Hi san,

You probably need to set the bottom axis Increment property to the desired value as explained in tutorial 4, available at TeeChart's program group. If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.

Thanks in advance.

Re: Repeated dates shown when time scale is set to less than 11

Posted: Wed Nov 23, 2011 4:15 am
by 13051459
Hi Narcis,

Thanks for your help. It works fine now. But the only problem we are facing is suppose the difference between the max and min date is 1 hour or 2 hour, we want to display the time in this fashion : 1:00,1:10,1:20,1:30............... 2:00. Minutes also should be displayed if the difference between min and max is less than 6 hours. Is there any property from which we can display the minutes also. Currently it is displaying only the rounded time. For example if we give difference = 1 hour. It is displaying only 2 times(example : 1:00 2:00). But we want to display the time in the fashion 1:00,1:10,1:20,1:30............... 2:00.


Thanks in Advance,

BR
San

Re: Repeated dates shown when time scale is set to less than 11

Posted: Wed Nov 23, 2011 11:37 am
by 10050769
Hello San,

I recomend you, use increment Steema.TeeChart.Utils.GetDateTimeStep to the axes and the DateTimeFormat to define how you want your DateTime format. You can do something as next:

Code: Select all

 private void InitializeChart()
        {
            Steema.TeeChart.Styles.Line line1 = new Line(tChart1.Chart);
            tChart1.Aspect.View3D = false;
            Random rnd = new Random();
             DateTime hour = new DateTime(2011,11,23,1,0,0);
            TimeSpan minutes = TimeSpan.FromMinutes(10);
            
            line1.XValues.DateTime = true;
            line1.DateTimeFormat = "hh:mm";
            //DateTime hour = new DateTime(0);
            for (int i = 0; i < 7; ++i)
            {
                line1.Add(hour, rnd.Next(100));
                hour += minutes;
            }

            tChart1.Axes.Bottom.Labels.DateTimeFormat = "hh:mm";
            tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.TenMinutes); 
            
        }
Can you please, tell us if previous code works as you want?

I hope will helps.

Thanks,