Page 1 of 1

Problem in making the vertical and horizontal grid lines

Posted: Fri Aug 07, 2009 11:29 am
by 9346725
Hi,
I am trying to make the horizontal and vertical grid lines visible in my application. But i am not able to make it. Actually I dont want to show all the labels in bottom axis. X axis values are of type datetime. I just need to show start time and end time of the bottom axis. Thats why i made the axis labels as invisible. Now my grid lines are also gone. Please let me know how can i make the grid lines visible without the labels.

Re: Problem in making the vertical and horizontal grid lines

Posted: Wed Aug 12, 2009 10:34 am
by 10050769
Hello Nitin,

I made a simple example that I thinks solve your problem and you can use a similar code for your application. Please check next code works as you want.

Code: Select all

 public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Bar bar;
        private void InitializeChart()
        {
            bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar.FillSampleValues(5);
            bar.Marks.Visible = false;
            tChart1.Legend.Visible = false;
            bar.XValues.DateTime = true;
            tChart1.Axes.Bottom.Labels.Angle = 90;

            for (int i = 0; i < 5; i++)
            {
                if (i == 0 || i == 4)
                {
                    bar[i].Label = DateTime.FromOADate(bar[i].X).ToShortDateString();
                }
                else
                {
                    bar[i].Label = " ";

                }
            }
        }
I hope that will helps