Teechart on canvas

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pdf Users
Newbie
Newbie
Posts: 2
Joined: Wed Apr 13, 2011 12:00 am

Teechart on canvas

Post by Pdf Users » Tue Feb 21, 2012 6:28 pm

Hi,
We have a custom control and would like to draw a teechart on some part of the control. Is there a way to give tchart a canvas for it to draw on?
Thank you in advance for your help,
Tamara.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Teechart on canvas

Post by Sandra » Thu Feb 23, 2012 2:36 pm

Hello Tamara,

I suggest you do something as next code where I have used a panel and I have drawn the chart into this panel:

Code: Select all

  public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.TChart tChart2;
        private void InitializeChart()
        {
            tChart2 = new TChart();
            this.Paint +=new PaintEventHandler(Form1_Paint);
        }

        void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = panel1.CreateGraphics();
            Rectangle rect = new Rectangle(panel1.Location.X, panel1.Location.Y, 400, 300);
            tChart2.Chart.Draw(g, rect); 
        }
Can you tell us if previous code works as you want? If it doesn't help you, can you please explain exactly what you want achieve?

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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

Pdf Users
Newbie
Newbie
Posts: 2
Joined: Wed Apr 13, 2011 12:00 am

Re: Teechart on canvas

Post by Pdf Users » Wed Feb 29, 2012 5:41 pm

Hi Sandra,
Thank for providing the example. It works great for me.
However, when we use the contour series with my data, we ran into some problem that the series doesn't appear on the chart.

Your contour_foot example data is continuous through out the x, y coordinate
Our data is not, some of our coordinate doesn't have any data

I wonder is it a requirement that we should have continuous data through out the coordinate? Please advice.

Thanks so much for your time,
Tamara.

P.S. Following is the data we feed into contour series:
DieInfo[22.1052780151367, 172.5]= 1.25
DieInfo[22, 172]= 1.25
DieInfo[22, 157]= 1.25
DieInfo[22, 142]= 1.31578947368421
DieInfo[22, 127]= 1.28205128205128
DieInfo[36, 202]= 1.19047619047619
DieInfo[36, 187]= 1.21951219512195
DieInfo[36, 172]= 1.23456790123457
DieInfo[36, 157]= 1.20481927710843
DieInfo[36, 142]= 1.19047619047619
DieInfo[36, 127]= 1.21951219512195
DieInfo[36, 112]= 1.19047619047619
DieInfo[36, 97]= 1.21951219512195
DieInfo[50, 232]= 1.26582278481013
DieInfo[50, 217]= 1.20481927710843
DieInfo[50, 202]= 1.20481927710843
DieInfo[50, 187]= 1.21951219512195
DieInfo[50, 172]= 1.25
DieInfo[50, 157]= 1.20481927710843
DieInfo[50, 142]= 1.20481927710843
DieInfo[50, 127]= 1.19047619047619
DieInfo[50, 112]= 1.19047619047619
DieInfo[50, 97]= 1.21951219512195
DieInfo[50, 82]= 1.19047619047619
DieInfo[50, 67]= 1.20481927710843
DieInfo[64, 247]= 1.23456790123457
DieInfo[64, 232]= 0
DieInfo[64, 217]= 1.19047619047619
DieInfo[64, 202]= 1.25
DieInfo[64, 187]= 1.20481927710843
DieInfo[64, 172]= 1.21951219512195
DieInfo[64, 157]= 1.21951219512195
DieInfo[64, 142]= 1.21951219512195
DieInfo[64, 127]= 1.20481927710843
DieInfo[64, 112]= 1.19047619047619
DieInfo[64, 97]= 1.20481927710843
DieInfo[64, 82]= 1.20481927710843
DieInfo[64, 67]= 1.20481927710843
DieInfo[78, 262]= 1.21951219512195
DieInfo[78, 247]= 1.20481927710843
DieInfo[78, 232]= 1.20481927710843
DieInfo[78, 217]= 1.21951219512195
DieInfo[78, 202]= 1.20481927710843
DieInfo[78, 187]= 1.23456790123457
DieInfo[78, 172]= 1.21951219512195
DieInfo[78, 157]= 1.20481927710843
DieInfo[78, 142]= 1.21951219512195
DieInfo[78, 127]= 1.25
DieInfo[78, 112]= 1.20481927710843
DieInfo[78, 97]= 1.20481927710843
DieInfo[78, 82]= 1.19047619047619
DieInfo[78, 67]= 1.23456790123457
DieInfo[78, 52]= 1.20481927710843
DieInfo[78, 37]= 1.21951219512195
DieInfo[93, 262]= 1.25
DieInfo[93, 247]= 1.25
DieInfo[93, 232]= 1.25
DieInfo[93, 217]= 1.23456790123457
DieInfo[93, 202]= 1.21951219512195
DieInfo[93, 187]= 1.23456790123457
DieInfo[93, 172]= 1.21951219512195
DieInfo[93, 157]= 1.21951219512195
DieInfo[93, 142]= 1.23456790123457
DieInfo[93, 127]= 1.20481927710843
DieInfo[93, 112]= 1.20481927710843
DieInfo[93, 97]= 1.20481927710843
DieInfo[93, 82]= 1.20481927710843
DieInfo[93, 67]= 1.21951219512195
DieInfo[93, 52]= 1.19047619047619
DieInfo[93, 37]= 1.19047619047619
DieInfo[107, 277]= 1.21951219512195
DieInfo[107, 262]= 1.20481927710843
DieInfo[107, 247]= 1.21951219512195
DieInfo[107, 232]= 1.26582278481013
DieInfo[107, 217]= 1.21951219512195
DieInfo[107, 202]= 2.7027027027027
DieInfo[107, 187]= 1.25
DieInfo[107, 172]= 1.23456790123457
DieInfo[107, 157]= 1.23456790123457
DieInfo[107, 142]= 1.21951219512195
DieInfo[107, 127]= 1.25
DieInfo[107, 112]= 1.21951219512195
DieInfo[107, 97]= 1.20481927710843
DieInfo[107, 82]= 1.21951219512195
DieInfo[107, 67]= 1.21951219512195
DieInfo[107, 52]= 1.21951219512195
DieInfo[107, 37]= 1.20481927710843
DieInfo[107, 22]= 1.20481927710843
DieInfo[121, 277]= 1.25
DieInfo[121, 262]= 1.25
DieInfo[121, 247]= 1.23456790123457
DieInfo[121, 232]= 1.23456790123457
DieInfo[121, 217]= 1.23456790123457
DieInfo[121, 202]= 1.21951219512195
DieInfo[121, 187]= 1.23456790123457
DieInfo[121, 172]= 1.23456790123457
DieInfo[121, 157]= 1.21951219512195
DieInfo[121, 142]= 1.21951219512195
DieInfo[121, 127]= 1.20481927710843
DieInfo[121, 112]= 1.20481927710843
DieInfo[121, 97]= 1.20481927710843
DieInfo[121, 82]= 1.20481927710843
DieInfo[121, 67]= 1.20481927710843
DieInfo[121, 52]= 1.21951219512195
DieInfo[121, 37]= 1.21951219512195
DieInfo[121, 22]= 1.20481927710843
DieInfo[135, 277]= 1.20481927710843
DieInfo[135, 262]= 1.21951219512195
DieInfo[135, 247]= 1.2987012987013
DieInfo[135, 232]= 1.25
DieInfo[135, 217]= 1.21951219512195
DieInfo[135, 202]= 1.21951219512195
DieInfo[135, 187]= 1.21951219512195
DieInfo[135, 172]= 1.23456790123457
DieInfo[135, 157]= 1.23456790123457
DieInfo[135, 142]= 1.21951219512195
DieInfo[135, 127]= 1.21951219512195
DieInfo[135, 112]= 1.23456790123457
DieInfo[135, 97]= 1.20481927710843
DieInfo[135, 82]= 1.25
DieInfo[135, 67]= 1.26582278481013
DieInfo[135, 52]= 1.25
DieInfo[135, 37]= 1.23456790123457
DieInfo[135, 22]= 1.20481927710843
DieInfo[150, 277]= 1.21951219512195
DieInfo[150, 262]= 1.23456790123457
DieInfo[150, 247]= 1.23456790123457
DieInfo[150, 232]= 1.21951219512195
DieInfo[150, 217]= 1.21951219512195
DieInfo[150, 202]= 1.21951219512195
DieInfo[150, 187]= 1.21951219512195
DieInfo[150, 172]= 1.21951219512195
DieInfo[150, 157]= 1.20481927710843
DieInfo[150, 142]= 1.21951219512195
DieInfo[150, 127]= 1.23456790123457
DieInfo[150, 112]= 1.20481927710843
DieInfo[150, 97]= 1.20481927710843
DieInfo[150, 82]= 1.23456790123457
DieInfo[150, 67]= 1.25
DieInfo[150, 52]= 1.21951219512195
DieInfo[150, 37]= 1.20481927710843
DieInfo[150, 22]= 1.20481927710843
DieInfo[164, 277]= 1.2987012987013
DieInfo[164, 262]= 1.23456790123457
DieInfo[164, 247]= 1.21951219512195
DieInfo[164, 232]= 1.21951219512195
DieInfo[164, 217]= 1.23456790123457
DieInfo[164, 202]= 2.63157894736842
DieInfo[164, 187]= 1.21951219512195
DieInfo[164, 172]= 1.21951219512195
DieInfo[164, 157]= 1.23456790123457
DieInfo[164, 142]= 1.20481927710843
DieInfo[164, 127]= 1.21951219512195
DieInfo[164, 112]= 1.21951219512195
DieInfo[164, 97]= 1.21951219512195
DieInfo[164, 82]= 1.21951219512195
DieInfo[164, 67]= 1.20481927710843
DieInfo[164, 52]= 1.21951219512195
DieInfo[164, 37]= 1.21951219512195
DieInfo[164, 22]= 1.20481927710843
DieInfo[178, 277]= 1.26582278481013
DieInfo[178, 262]= 1.25
DieInfo[178, 247]= 1.21951219512195
DieInfo[178, 232]= 1.21951219512195
DieInfo[178, 217]= 1.21951219512195
DieInfo[178, 202]= 1.23456790123457
DieInfo[178, 187]= 1.23456790123457
DieInfo[178, 172]= 1.23456790123457
DieInfo[178, 157]= 1.20481927710843
DieInfo[178, 142]= 1.20481927710843
DieInfo[178, 127]= 1.23456790123457
DieInfo[178, 112]= 1.20481927710843
DieInfo[178, 97]= 1.20481927710843
DieInfo[178, 82]= 1.21951219512195
DieInfo[178, 67]= 1.21951219512195
DieInfo[178, 52]= 1.21951219512195
DieInfo[178, 37]= 1.20481927710843
DieInfo[178, 22]= 1.21951219512195
DieInfo[192, 277]= 1.26582278481013
DieInfo[192, 262]= 1.26582278481013
DieInfo[192, 247]= 1.21951219512195
DieInfo[192, 232]= 1.28205128205128
DieInfo[192, 217]= 1.21951219512195
DieInfo[192, 202]= 1.26582278481013
DieInfo[192, 187]= 1.21951219512195
DieInfo[192, 172]= 1.23456790123457
DieInfo[192, 157]= 1.21951219512195
DieInfo[192, 142]= 1.23456790123457
DieInfo[192, 127]= 1.21951219512195
DieInfo[192, 112]= 1.23456790123457
DieInfo[192, 97]= 1.21951219512195
DieInfo[192, 82]= 1.25
DieInfo[192, 67]= 1.25
DieInfo[192, 52]= 1.23456790123457
DieInfo[192, 37]= 1.23456790123457
DieInfo[192, 22]= 0
DieInfo[206, 262]= 1.20481927710843
DieInfo[206, 247]= 1.21951219512195
DieInfo[206, 232]= 1.23456790123457
DieInfo[206, 217]= 1.23456790123457
DieInfo[206, 202]= 1.21951219512195
DieInfo[206, 187]= 1.21951219512195
DieInfo[206, 172]= 1.21951219512195
DieInfo[206, 157]= 1.25
DieInfo[206, 142]= 0
DieInfo[206, 127]= 1.20481927710843
DieInfo[206, 112]= 1.21951219512195
DieInfo[206, 97]= 1.21951219512195
DieInfo[206, 82]= 1.23456790123457
DieInfo[206, 67]= 1.21951219512195
DieInfo[206, 52]= 1.23456790123457
DieInfo[206, 37]= 1.21951219512195
DieInfo[221, 262]= 1.23456790123457
DieInfo[221, 247]= 1.23456790123457
DieInfo[221, 232]= 1.23456790123457
DieInfo[221, 217]= 1.21951219512195
DieInfo[221, 202]= 1.23456790123457
DieInfo[221, 187]= 1.21951219512195
DieInfo[221, 172]= 1.21951219512195
DieInfo[221, 157]= 1.21951219512195
DieInfo[221, 142]= 1.23456790123457
DieInfo[221, 127]= 1.23456790123457
DieInfo[221, 112]= 1.23456790123457
DieInfo[221, 97]= 1.23456790123457
DieInfo[221, 82]= 1.23456790123457
DieInfo[221, 67]= 1.26582278481013
DieInfo[221, 52]= 1.31578947368421
DieInfo[221, 37]= 1.26582278481013
DieInfo[235, 247]= 1.26582278481013
DieInfo[235, 232]= 1.25
DieInfo[235, 217]= 1.23456790123457
DieInfo[235, 202]= 1.23456790123457
DieInfo[235, 187]= 1.23456790123457
DieInfo[235, 172]= 1.25
DieInfo[235, 157]= 1.21951219512195
DieInfo[235, 142]= 1.21951219512195
DieInfo[235, 127]= 1.21951219512195
DieInfo[235, 112]= 1.23456790123457
DieInfo[235, 97]= 1.21951219512195
DieInfo[235, 82]= 1.21951219512195
DieInfo[235, 67]= 1.23456790123457
DieInfo[235, 52]= 1.21951219512195
DieInfo[249, 232]= 0
DieInfo[249, 217]= 1.23456790123457
DieInfo[249, 202]= 0
DieInfo[249, 187]= 1.25
DieInfo[249, 172]= 1.26582278481013
DieInfo[249, 157]= 1.25
DieInfo[249, 142]= 1.25
DieInfo[249, 127]= 0
DieInfo[249, 112]= 1.25
DieInfo[249, 97]= 1.28205128205128
DieInfo[249, 82]= 1.28205128205128
DieInfo[249, 67]= 1.28205128205128
DieInfo[263, 202]= 0
DieInfo[263, 187]= 1.26582278481013
DieInfo[263, 172]= 1.23456790123457
DieInfo[263, 157]= 1.26582278481013
DieInfo[263, 142]= 1.23456790123457
DieInfo[263, 127]= 1.25
DieInfo[263, 112]= 1.23456790123457
DieInfo[263, 97]= 1.26582278481013
DieInfo[277, 172]= 1.2987012987013
DieInfo[277, 157]= 0
DieInfo[277, 142]= 0
DieInfo[277, 127]= 1.47058823529412

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Teechart on canvas

Post by Sandra » Fri Mar 02, 2012 9:20 am

Hello Tamara,

I recommend you take a look in here to understand how you must add values in the 3D Grid Series.

Thanks,
Best Regards,
Sandra Pazos / 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