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

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
san
Newbie
Newbie
Posts: 2
Joined: Tue Jan 13, 2009 12:00 am

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

Post by san » Tue Nov 22, 2011 2:19 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Tue Nov 22, 2011 2:48 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

san
Newbie
Newbie
Posts: 2
Joined: Tue Jan 13, 2009 12:00 am

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

Post by san » Wed Nov 23, 2011 4:15 am

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

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

Post by Sandra » Wed Nov 23, 2011 11:37 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply