Page 1 of 1

Flexible display Mask

Posted: Thu Oct 22, 2015 10:46 am
by 15675274

Code: Select all

     /// <summary>
    /// XYZ轴类
    /// </summary>
        public class NumberAxis
        {
            public DateTime X
            {
                get;
                set;
            }
            public int Y { get; set; }
            public int Z { get; set; }
        }

       private void Form1_Load(object sender, EventArgs e)
        {
            points3D1 = new Points3D(tChart1.Chart);
            this.tChart1.Header.Text = "端口XXXX";
            this.tChart1.Axes.Left.Title.Caption = "YYYY";
            this.tChart1.Axes.Bottom.Title.Caption = "XXXX";
            this.tChart1.Axes.Depth.Title.Caption = "ZZZZ";
            this.tChart1.Axes.Depth.Visible = true;

            List<NumberAxis> stemp = new List<NumberAxis>();
            for (int t = 0; t < 20; t++)
            {
                DateTime dt = DateTime.Parse("2015-02-14 12:02:06");
                NumberAxis ss = new NumberAxis() { X = dt.AddDays(t), Y = t, Z = t };
                stemp.Add(ss);
            }
            tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.PointValue;
            tChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            tChart1.Axes.Bottom.Labels.Angle = 90;
            tChart1.Series[0].Marks.Visible = true;
            tChart1.Series[0].Marks.Style = MarksStyles.XY;
            this.points3D1.Marks.MultiLine = true;

            this.tChart1.Series[0].GetSeriesMark += new Series.GetSeriesMarkEventHandler(Form1_GetSeriesMark);
            points3D1.DataSource = stemp;
            points3D1.XValues.DataMember = "X";
            points3D1.YValues.DataMember = "Y";
            points3D1.ZValues.DataMember = "Z";
        }

        void Form1_GetSeriesMark(Series series, GetSeriesMarkEventArgs e)
        {
            e.MarkText +=Environment.NewLine+ series.ValuesLists[2][e.ValueIndex].ToString(series.ValueFormat);
        }


Re: Flexible display Mask

Posted: Fri Oct 23, 2015 8:13 am
by narcis
Hi Chinfot,

In this case I recommend you to use MarksTip tool. You'll find an example at All Features\Welcome !\Tools\Mark tips in the features demo available at TeeChart's program group. You'll find more information about TeeChart tools usage in tutorial 18 at the TeeChart .NET Tutorials section at the TeeChart Docs page.