Problem in making the vertical and horizontal grid lines

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Problem in making the vertical and horizontal grid lines

Post by Nitin » Fri Aug 07, 2009 11:29 am

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.

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

Re: Problem in making the vertical and horizontal grid lines

Post by Sandra » Wed Aug 12, 2009 10:34 am

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
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