Page 1 of 1

points3D show all point info

Posted: Tue Sep 22, 2015 1:43 am
by 15675274

Code: Select all

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

        private void Form2_Load(object sender, EventArgs e)[attachment=0]QQ截图20150922093643.png[/attachment]
        {
            List<NumberAxis> stemp = new List<NumberAxis>();
            NumberAxis s1 = new NumberAxis() { X = 1, Y = 1, Z = 1 };
            NumberAxis s2 = new NumberAxis() { X = 2, Y = 2, Z = 2 };
            NumberAxis s3 = new NumberAxis() { X = 3, Y = 3, Z = 3 };
            NumberAxis s4 = new NumberAxis() { X = 4, Y = 3, Z = 4 };
            NumberAxis s5 = new NumberAxis() { X = 5, Y = 5, Z = 5 };
            stemp.Add(s1);
            stemp.Add(s2);
            stemp.Add(s3);
            stemp.Add(s4);
            stemp.Add(s5);

            points3D1.DataSource = stemp;
            points3D1.XValues.DataMember = "X";
            points3D1.XValues.DataMember = "Y";
            points3D1.ZValues.DataMember = "Z";
            tChart1.Refresh();
            this.tChart1.Series[0].Marks.Visible = true;
            this.tChart1.Series[0].Marks.Style = MarksStyles.XY;
        }

Re: points3D show all point info

Posted: Tue Sep 22, 2015 1:13 pm
by Christopher
Hello,

You should be able to use the GetSeriesMark event, e.g.

Code: Select all

    private void InitializeChart()
    {
      Points3D points3D1 = new Points3D(tChart1.Chart);

      points3D1.FillSampleValues();

      this.tChart1.Series[0].Marks.Visible = true;
      this.tChart1.Series[0].Marks.Style = MarksStyles.XY;

      this.tChart1.Series[0].GetSeriesMark += Form1_GetSeriesMark;

    }

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