Page 1 of 1

Moving marks

Posted: Mon Dec 01, 2008 4:10 pm
by 13046960
Hi,

I am trying to move marks in a serie created in runtime but I can not get it to work. Please find code below.

Code: Select all

        private void Form1_Load(object sender, System.EventArgs e)
        {
            Steema.TeeChart.Styles.Points pie1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
            tChart1.Aspect.View3D = false;
            pie1.FillSampleValues(20);
            Bitmap b = tChart1.Bitmap;
            Steema.TeeChart.Styles.SeriesMarks.Position mp3 = pie1.Marks.Positions[3];
            mp3.Custom = true;
            mp3.ArrowTo.X = mp3.ArrowTo.X - 50;
            mp3.LeftTop.X = mp3.LeftTop.X - 50;
            pie1.Marks.Positions[5].Custom = true;
            pie1.Marks.Positions[5].ArrowTo.Y = pie1.Marks.Positions[5].ArrowTo.Y + 50;
            pie1.Marks.Positions[5].LeftTop.Y = pie1.Marks.Positions[5].LeftTop.Y + 50;
            tChart1.Refresh();
        }
Please help!

Posted: Mon Dec 01, 2008 4:25 pm
by narcis
Hi Janne,

Most likely the problem is that you need to set series' marks to visible before:

Code: Select all

			Steema.TeeChart.Styles.Points pie1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
			tChart1.Aspect.View3D = false;
			pie1.FillSampleValues(20);
			pie1.Marks.Visible = true;
			tChart1.Draw();
			Steema.TeeChart.Styles.SeriesMarks.Position mp3 = pie1.Marks.Positions[3];
			mp3.Custom = true;
			mp3.ArrowTo.X = mp3.ArrowTo.X - 50;
			mp3.LeftTop.X = mp3.LeftTop.X - 50;
			pie1.Marks.Positions[5].Custom = true;
			pie1.Marks.Positions[5].ArrowTo.Y = pie1.Marks.Positions[5].ArrowTo.Y + 50;
			pie1.Marks.Positions[5].LeftTop.Y = pie1.Marks.Positions[5].LeftTop.Y + 50;
			tChart1.Refresh();