Page 1 of 1

Show time in Data sheet of the chart editor

Posted: Thu May 20, 2010 9:18 am
by 15654539
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

Re: Show time in Data sheet of the chart editor

Posted: Thu May 20, 2010 12:24 pm
by narcis
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;
        }

Re: Show time in Data sheet of the chart editor

Posted: Thu Sep 30, 2010 3:01 pm
by 15654539
Hello,

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

Thanks,

Re: Show time in Data sheet of the chart editor

Posted: Thu Sep 30, 2010 3:04 pm
by narcis
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.