Show time in Data sheet of the chart editor

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Show time in Data sheet of the chart editor

Post by acastro » Thu May 20, 2010 9:18 am

Hi,

I have a Datetime serie. I open the Data sheet in the chart editor but in the X column I only can see the date and not the time.
Is there any way to show also the time in the chart editor?

Thanks in advance

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

Re: Show time in Data sheet of the chart editor

Post by Narcís » Thu May 20, 2010 12:24 pm

Hello wakeup,

I'm afraid this is not possible for now. We have added your request to the wish-list (TF02014903) to be considered for inclusion in future releases.

In the meantime you could format TeeChart's data using a DataGrid as in the All Features\Welcome !\Components\Chart Grid example at the features demo, available at TeeChart's program group. Finally, you can set DataGrid's format as shown here:

Code: Select all

        public Form1()
        {
            InitializeComponent();

            DataGrid dataGrid1 = new DataGrid();
            this.Controls.Add(dataGrid1);
            
            dataGrid1.Dock = DockStyle.Fill;
            dataGrid1.SetDataBinding(GetData(), "TeeDataTable");

            DataGridTextBoxColumn xColumn = new DataGridTextBoxColumn();

            xColumn.MappingName = "X";
            xColumn.HeaderText = "X";

            DataGridTextBoxColumn yColumn = new DataGridTextBoxColumn();

            yColumn.MappingName = "Y";
            yColumn.HeaderText = "Y";

            DataGridTextBoxColumn dtColumn = new DataGridTextBoxColumn();

            dtColumn.MappingName = "DT";
            dtColumn.HeaderText = "My DateTime";
            dtColumn.Format = "MM/dd/yyyy hh:mm:ss";

            DataGridTableStyle tableStyle = new DataGridTableStyle();
            tableStyle.MappingName = "TeeDataTable";

            GridColumnStylesCollection columnStyles;
            columnStyles = tableStyle.GridColumnStyles;
            columnStyles.Add(xColumn);
            columnStyles.Add(yColumn);
            columnStyles.Add(dtColumn);

            dataGrid1.TableStyles.Add(tableStyle);
        }

        private DataSet GetData()
        {
            DataSet TeeDataSet = new DataSet();
            DataTable TeeDataTable = new DataTable("TeeDataTable");

            DataRow newRow;

            DataColumn xval = new DataColumn("X", typeof(double));
            DataColumn yval = new DataColumn("Y", typeof(double));
            DataColumn dt = new DataColumn("DT", typeof(DateTime));

            TeeDataTable.Columns.Add(xval);
            TeeDataTable.Columns.Add(yval);
            TeeDataTable.Columns.Add(dt);

            for (int i = 0; i < 10; i++)
            {
                newRow = TeeDataTable.NewRow();
                newRow[xval] = i;
                newRow[yval] = i;
                newRow[dt] = DateTime.Now.AddHours(i);
                TeeDataTable.Rows.Add(newRow);
            }

            TeeDataSet.Tables.Add(TeeDataTable);
            return TeeDataSet;
        }
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

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Show time in Data sheet of the chart editor

Post by acastro » Thu Sep 30, 2010 3:01 pm

Hello,

There is any place where I can see the wish-list and see if it is goint to be solved?

Thanks,

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

Re: Show time in Data sheet of the chart editor

Post by Narcís » Thu Sep 30, 2010 3:04 pm

Hi wakeup,

Wish and bug lists are not public. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them. You can also ask here for any issue status. Also notice I have increased TF02014903's priority.
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

Post Reply