How to draw contour from given data?
How to draw contour from given data?
Hi Steema Support,
We want to create contour for the data(as given in attached file).
It will so helpful for us if you please provide any alternative solution asap.
Thanks in advance.
Thanks and Regards
Planoresearch
We want to create contour for the data(as given in attached file).
It will so helpful for us if you please provide any alternative solution asap.
Thanks in advance.
Thanks and Regards
Planoresearch
- Attachments
-
- Contour.rar
- contour data.
- (10.87 KiB) Downloaded 799 times
Re: How to draw contour from given data?
Hi Steema Team,
Is it possible or not Please send us a reply asap. this is very urgent.
Thanks
Plano Team
Is it possible or not Please send us a reply asap. this is very urgent.
Thanks
Plano Team
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
I have modified your contour file: and can use it like this:amol wrote:Is it possible or not Please send us a reply asap. this is very urgent.
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Contour contour = new Contour(tChart1.Chart);
contour.IrregularGrid = true;
tChart1.Legend.Visible = false;
Random rnd = new Random();
int count = Assignment_teechart.ContourData.ZValues.Count;
for (int x = 0; x < count; x++)
{
for (int z = 0; z < count; z++)
{
contour.Add(Assignment_teechart.ContourData.XValues[x], Assignment_teechart.ContourData.YValues[x], Assignment_teechart.ContourData.ZValues[z]);
}
}
}
Code: Select all
contour.Add(Assignment_teechart.ContourData.XValues[x], rnd.NextDouble(), Assignment_teechart.ContourData.ZValues[z]);
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
Actually, this probably works as you would better expect:
Which gives me this:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Contour contour = new Contour(tChart1.Chart);
contour.IrregularGrid = true;
tChart1.Legend.Visible = false;
Random rnd = new Random();
int count = Assignment_teechart.ContourData.ZValues.Count;
int y;
for (int x = 0; x < count; x+=46)
{
for (int z = 0; z < 47; z++)
{
y = x > 0 ? z * (x / 46) : z;
contour.Add(Assignment_teechart.ContourData.XValues[z], Assignment_teechart.ContourData.YValues[y], Assignment_teechart.ContourData.ZValues[x]);
}
}
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
A third answer
Using and the following code:
I get this:
not as pretty as the last answer, but probably more faithful to the original data.
Using and the following code:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Contour contour = new Contour(tChart1.Chart);
contour.IrregularGrid = true;
tChart1.Legend.Visible = false;
Random rnd = new Random();
int length = Assignment_teechart.ContourData.ZValues.Count;
int y = 0;
for (int x = 0; x < length; x += 47)
{
for (int z = 0; z < 47; z++)
{
contour.Add(Assignment_teechart.ContourData.XValues[x], Assignment_teechart.ContourData.YValues[y], Assignment_teechart.ContourData.ZValues[z]);
y++;
}
}
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to draw contour from given data?
Hi,
We have modified the contour data file. Please create contour using this data file attached with mail.
We are waiting for your response.
Thanks in advance
Plano Team
We have modified the contour data file. Please create contour using this data file attached with mail.
We are waiting for your response.
Thanks in advance
Plano Team
- Attachments
-
- Data.rar
- Contour data file
- (2.23 KiB) Downloaded 750 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
Can you please me why you cannot plot this data extrapolating from the technique in the last answer I gave you?amol wrote:Hi,
We have modified the contour data file. Please create contour using this data file attached with mail.
We are waiting for your response.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to draw contour from given data?
Hi Steema,
We used below way suggested by you for plotting contour. but in both way we are not able to understand what is significance of 46 and 47 in loop. Is it a fixed value(Static) and how can use it according to our new data (sent you yesterday).
why you are calculating y value.
Way :1
int y;
for (int x = 0; x < count; x += 46)
{
for (int z = 0; z < 47; z++)
{
y = x > 0 ? z * (x / 46) : z;
contour.Add(Assignment_teechart.ContourData.XValues[z], Assignment_teechart.ContourData.YValues[y], Assignment_teechart.ContourData.ZValues[x]);
}
}
Way: 2
int y = 0;
for (int x = 0; x < Assignment_teechart.ContourData.ZValues.Count; x += 47)
{
for (int z = 0; z < 47; z++)
{
contour.Add(Assignment_teechart.ContourData.XValues[x], Assignment_teechart.ContourData.YValues[y], Assignment_teechart.ContourData.ZValues[z]);
y++;
}
}
one more thing we want to ask, is it necessary to use loop for plotting contour.
is it possible to create contour by this way?
contour.Add(Assignment_teechart.ContourData.Xvalue.ToArray(), Assignment_teechart.ContourData.Yvalue.ToArray(), Assignment_teechart.ContourData.Zvalue.ToArray());
Thanks
Plano Team
We used below way suggested by you for plotting contour. but in both way we are not able to understand what is significance of 46 and 47 in loop. Is it a fixed value(Static) and how can use it according to our new data (sent you yesterday).
why you are calculating y value.
Way :1
int y;
for (int x = 0; x < count; x += 46)
{
for (int z = 0; z < 47; z++)
{
y = x > 0 ? z * (x / 46) : z;
contour.Add(Assignment_teechart.ContourData.XValues[z], Assignment_teechart.ContourData.YValues[y], Assignment_teechart.ContourData.ZValues[x]);
}
}
Way: 2
int y = 0;
for (int x = 0; x < Assignment_teechart.ContourData.ZValues.Count; x += 47)
{
for (int z = 0; z < 47; z++)
{
contour.Add(Assignment_teechart.ContourData.XValues[x], Assignment_teechart.ContourData.YValues[y], Assignment_teechart.ContourData.ZValues[z]);
y++;
}
}
one more thing we want to ask, is it necessary to use loop for plotting contour.
is it possible to create contour by this way?
contour.Add(Assignment_teechart.ContourData.Xvalue.ToArray(), Assignment_teechart.ContourData.Yvalue.ToArray(), Assignment_teechart.ContourData.Zvalue.ToArray());
Thanks
Plano Team
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
Way 2 is the correct way, using x += 47. The number 47 comes from the size of the loop. In the original data:amol wrote: We used below way suggested by you for plotting contour. but in both way we are not able to understand what is significance of 46 and 47 in loop. Is it a fixed value(Static) and how can use it according to our new data (sent you yesterday).
Code: Select all
YArray = new double[] { 3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 , 3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3
Code: Select all
double[] YArray= new double[] { 61.779,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,
61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,61.779 ,
61.779 ,61.779 ,61.779
In Way 2 we do not calculate the y value.amol wrote: why you are calculating y value.
Yes, it is necessary, as the TeeChart code cannot automatically derive the loop sizes, that is, the numbers 47 and 36 and so on.amol wrote: one more thing we want to ask, is it necessary to use loop for plotting contour.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to draw contour from given data?
Hi Steema forum,
Thanks for quick response, we are using second way but not able to display any contour .
This code is done according to data file which we have sent you yesterday. in below code don't get confused in argument of contour.Add() method (y & z argument). this is according to data file. please look data file.
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Contour contour = new Contour(tChart1.Chart);
contour.IrregularGrid = true;
tChart1.Legend.Visible = false;
int y = 0;
for (int x = 0; x < Assignment_teechart.Class1.ZValues.Count; x += 36)
{
for (int z = 0; z < 36; z++)
{
contour.Add(Assignment_teechart.Class1.XValues[x], Assignment_teechart.Class1.ZValues[y], Assignment_teechart.Class1.YValues[z]);
y++;
}
}
}
Thanks
Plano team
Thanks for quick response, we are using second way but not able to display any contour .
This code is done according to data file which we have sent you yesterday. in below code don't get confused in argument of contour.Add() method (y & z argument). this is according to data file. please look data file.
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Contour contour = new Contour(tChart1.Chart);
contour.IrregularGrid = true;
tChart1.Legend.Visible = false;
int y = 0;
for (int x = 0; x < Assignment_teechart.Class1.ZValues.Count; x += 36)
{
for (int z = 0; z < 36; z++)
{
contour.Add(Assignment_teechart.Class1.XValues[x], Assignment_teechart.Class1.ZValues[y], Assignment_teechart.Class1.YValues[z]);
y++;
}
}
}
Thanks
Plano team
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
Can you please provide me with the classes you are using for your data. Your previous attachment contained Data\Class1.cs, but Class1 has no static methods, meaning that I cannot run the code sample you provide in your last message in this thread.amol wrote: Thanks for quick response, we are using second way but not able to display any contour .
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to draw contour from given data?
Hi Steema Forum.
Thank you so much for prompt reply. please find attached data file with static methods.
Thanks
Plano Team
Thank you so much for prompt reply. please find attached data file with static methods.
Thanks
Plano Team
- Attachments
-
- Data.rar
- Data File
- (2.51 KiB) Downloaded 811 times
Re: How to draw contour from given data?
Hi Steema forum,
Please response ASAP.
Thanks
Plano
Please response ASAP.
Thanks
Plano
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw contour from given data?
amol wrote: Thank you so much for prompt reply. please find attached data file with static methods.
This code seems to plot the data:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Contour contour = new Contour(tChart1.Chart);
contour.IrregularGrid = true;
tChart1.Legend.Visible = false;
Random rnd = new Random();
int length = Assignment_teechart.Class1.ZValues.Count;
int y = 0;
int step = 36;
for (int x = 0; x < length; x += step)
{
for (int z = 0; z < step; z++)
{
contour.Add(Assignment_teechart.Class1.ZValues[x], Assignment_teechart.Class1.YValues[y], Assignment_teechart.Class1.XValues[z]);
y++;
}
}
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |