Time Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
tenaris
Newbie
Newbie
Posts: 39
Joined: Fri Mar 02, 2007 12:00 am

Time Chart

Post by tenaris » Tue Aug 02, 2011 1:24 am

Hi

I need to make a time graph like the attached image but in vertical direction.
I need that in the left axe shows the time and the bottom axe shows a progressive number
And it could be better if is a line graph.
How can I do that?

Thanks!
Attachments
Dibujo1.JPG
Dibujo1.JPG (48.63 KiB) Viewed 3595 times

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

Re: Time Chart

Post by Sandra » Tue Aug 02, 2011 11:35 am

Hello ternaris,

I have made a simple example, where Y values are DateTime using method ToOADate() and I think next code help you to achieve as you want:

Code: Select all

 public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        private void InitializeChart()
        {
            Steema.TeeChart.Styles.HorizBar horizBar = new Steema.TeeChart.Styles.HorizBar(tChart1.Chart);
            horizBar.YValues.DateTime = true;
            tChart1.Aspect.View3D = false;

            DateTime today = DateTime.Today;
            TimeSpan oneDay = TimeSpan.FromDays(1); 
            for (int i = 1; i < 10; i++)
            {
                    horizBar.Add(i,today.ToOADate(),Color.Green);
                    today += oneDay;
            } 
        }
Could you please, tell us if previous code works fine to you?

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