Populating contour, filled levels
Populating contour, filled levels
I'm trying to use contour with filled levels in winforms using VS2008
Using contour.Add(double X, double Y, double Z), chart does not display the data.
When using contour.FillSampleValues(10) the chart displays the sample data, but I don't have the source code and can't step into this function to see how it populates the series.
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//contour1.FillSampleValues(10);
}
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
contour1.Add((double)j, (double)i/10, (double)i);
}
}
}
}
}
Using contour.Add(double X, double Y, double Z), chart does not display the data.
When using contour.FillSampleValues(10) the chart displays the sample data, but I don't have the source code and can't step into this function to see how it populates the series.
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//contour1.FillSampleValues(10);
}
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
contour1.Add((double)j, (double)i/10, (double)i);
}
}
}
}
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi prle,
Such series work as I described here.
Anyway, in your code you just need to add:
So that code below works fine for me here.
Such series work as I described here.
Anyway, in your code you just need to add:
Code: Select all
contour1.FillLevels = true;
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Contour contour1 = new Steema.TeeChart.Styles.Contour(tChart1.Chart);
contour1.FillLevels = true;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
contour1.Add((double)j, (double)i / 10, (double)i);
}
}
}
Best Regards,
Narcís Calvet / 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 |
Populating contour, filled levels
Hi Narcis,
Thank you for the quick reply, your code works fine.
There are a couple more issues I found with contour series:
1. When I changed your code to add several points in irregular grid
the chart does not display any data, but both the bottom and left axis are scaled correctly. This is what I really need to display.
2. When I changed your code to add a single point using a single call to
the chart does not display this point. I would expect a uniform colour across entire chart using either maximum or minimum level colour.
3. When contour1 is created at design time and FillLevels property is checked, using does not put the data on the chart.
Thank you for the quick reply, your code works fine.
There are a couple more issues I found with contour series:
1. When I changed your code to add several points in irregular grid
Code: Select all
contour1.IrregularGrid = true;
contour1.Add(1.1, 0.25, 1.6);
contour1.Add(1.8, 0.15, 2.6);
contour1.Add(2.1, 0.5, 0.6);
2. When I changed your code to add a single point using a single call to
Code: Select all
contour1.Add(1.1, 0.25, 1.6);
3. When contour1 is created at design time and FillLevels property is checked, using
Code: Select all
contour1.Add(...)
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi prle,
With a Contour series code below also works:
Which is the exact code you are using for populating contour series here?
Thanks in advance.
The (X,Z) grid has to be evenly spaced, even in an irregular grid. You also need a minimum of 4 points to plot an irregular grid. In such circumstances you may better use a ColorGrid series. For example, this works:1. When I changed your code to add several points in irregular grid
Code:
contour1.IrregularGrid = true;
contour1.Add(1.1, 0.25, 1.6);
contour1.Add(1.8, 0.15, 2.6);
contour1.Add(2.1, 0.5, 0.6);
the chart does not display any data, but both the bottom and left axis are scaled correctly. This is what I really need to display.
Code: Select all
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.IrregularGrid = true;
colorGrid1.Add(0.0, 1, 0.0);
colorGrid1.Add(0.1, 1, 0.0);
colorGrid1.Add(0.0, 1, 2.0);
colorGrid1.Add(0.1, 1, 2.0);
Code: Select all
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Contour contour1 = new Steema.TeeChart.Styles.Contour(tChart1.Chart);
contour1.IrregularGrid = true;
contour1.Add(1.1, 0.25, 0.6);
contour1.Add(1.8, 0.15, 0.6);
contour1.Add(2.5, 0.5, 0.6);
contour1.Add(1.1, 0.25, 1.6);
contour1.Add(1.8, 0.15, 1.6);
contour1.Add(2.5, 0.5, 1.6);
contour1.Add(1.1, 0.25, 2.6);
contour1.Add(1.8, 0.15, 2.6);
contour1.Add(2.5, 0.5, 2.6);
Using a ColorGrid series this also works:2. When I changed your code to add a single point using a single call to
Code:
contour1.Add(1.1, 0.25, 1.6);
the chart does not display this point. I would expect a uniform colour across entire chart using either maximum or minimum level colour.
Code: Select all
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.IrregularGrid = true;
colorGrid1.Add(1.1, 0.25, 1.6);
I'm not able to reproduce this here adding a Contour series, enabling Filled checkbox and populating a Contour series like this:3. When contour1 is created at design time and FillLevels property is checked, using
Code:
contour1.Add(...)
does not put the data on the chart.
Code: Select all
contour1.Add(1.1, 0.25, 0.6);
contour1.Add(1.8, 0.15, 0.6);
contour1.Add(2.5, 0.5, 0.6);
contour1.Add(1.1, 0.25, 1.6);
contour1.Add(1.8, 0.15, 1.6);
contour1.Add(2.5, 0.5, 1.6);
contour1.Add(1.1, 0.25, 2.6);
contour1.Add(1.8, 0.15, 2.6);
contour1.Add(2.5, 0.5, 2.6);
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |
Populating contour, filled levels
Hi Narcis,
Thank you for the explanation. It seems that neither ColorGrid nor Contour are suitable for my application.
I need to display the fruit sweetness in geographic coordinates, where measurements are tagged using GPS. My X is longitude, Z is latitude, and data points are not evenly spaced. The operator can walk to any fruit on any tree to collect a sample. There can be any number of samples. The Y coordinate represents sweetness result using colour, and the chart should easily identify areas needing additional treatment such as fertilizer.
1. Can you suggest a suitable TeeChart series to display such data?
2. Can you please let me know what is the difference between setting the IrregularGrid property to true and false?
Thank you for the explanation. It seems that neither ColorGrid nor Contour are suitable for my application.
I need to display the fruit sweetness in geographic coordinates, where measurements are tagged using GPS. My X is longitude, Z is latitude, and data points are not evenly spaced. The operator can walk to any fruit on any tree to collect a sample. There can be any number of samples. The Y coordinate represents sweetness result using colour, and the chart should easily identify areas needing additional treatment such as fertilizer.
1. Can you suggest a suitable TeeChart series to display such data?
2. Can you please let me know what is the difference between setting the IrregularGrid property to true and false?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi prle,
If you need to plot additional areas here you may be interested in using Map series for plotting geographic coordinates too.
You could try using Bubble series. Its radius being X,Y geographic coordinates and Radius/Color values for sweetness.1. Can you suggest a suitable TeeChart series to display such data?
If you need to plot additional areas here you may be interested in using Map series for plotting geographic coordinates too.
Yes, here I explained how IrregularGrid property should be used.2. Can you please let me know what is the difference between setting the IrregularGrid property to true and false?
Best Regards,
Narcís Calvet / 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 |
Populating contour, filled levels
Hi Narcis,
Thank you for the quick reply.
After having another look, the IrregularGrid property does not work as described in TeeChart help or in your description. I would like to report a bug: Contour does not work with IrregularGrid set to true.
According to the TeeChart help file, the IrregularGrid is a read/write property.
Description for IrregularGrid is "Determine if X and Z values are equi-distant or not"
In your description you added another two points:
"You need to set IrregularGrid property to true (by default set to false) in the following cases:
1. When X and Z intervals are not equidistant.
2. When X or Z intervals ire different from 1.
3. When X or Z intervals have negative values."
I don't see a design reason why the scattered X/Z points can't be shown as an irregular grid contour.
Also, my data fits the description stated in the help file, and your explanation, X and Z intervals are not equidistant, X or Z intervals are different from 1, X or Z intervals can have negative values.
Thank you for the quick reply.
After having another look, the IrregularGrid property does not work as described in TeeChart help or in your description. I would like to report a bug: Contour does not work with IrregularGrid set to true.
According to the TeeChart help file, the IrregularGrid is a read/write property.
Code: Select all
public Boolean IrregularGrid {get; set;}
In your description you added another two points:
"You need to set IrregularGrid property to true (by default set to false) in the following cases:
1. When X and Z intervals are not equidistant.
2. When X or Z intervals ire different from 1.
3. When X or Z intervals have negative values."
I don't see a design reason why the scattered X/Z points can't be shown as an irregular grid contour.
Also, my data fits the description stated in the help file, and your explanation, X and Z intervals are not equidistant, X or Z intervals are different from 1, X or Z intervals can have negative values.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi prle,
Ok, I have added the issue (TF02013803) to the list to be investigated.
Ok, I have added the issue (TF02013803) to the list to be investigated.
Best Regards,
Narcís Calvet / 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 |