Page 1 of 1

Time Chart

Posted: Tue Aug 02, 2011 1:24 am
by 9644416
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!

Re: Time Chart

Posted: Tue Aug 02, 2011 11:35 am
by 10050769
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,