Page 1 of 1
Coloring Shapes in Maps in TeeChart v3.5.x.x
Posted: Thu Jul 23, 2009 11:25 pm
by 9644963
I'm trying to color individual shapes for a map. The code had worked before in v2, but I am trying v3.5.x.x and find that the same code does not work (the code below takes place within a for loop):"
Code: Select all
// clr is a pre-calculated color
map1.Colors.Add(clr);
poly.Add(data[0], data[1]);
poly.Add(data[2], data[3]);
poly.Add(data[4], data[5]);
poly.Add(data[6], data[7]);
map1.Shapes.Add(poly);
Looking around the forum, it seems to me that maybe coloring shapes for a map does not work properly at this time. True?
Jon
Re: Coloring Shapes in Maps in TeeChart v3.5.x.x
Posted: Fri Jul 24, 2009 11:31 am
by narcis
Hi Jon,
Could you please attach a simple example project or a code snippet we can run "as-is" to reproduce the problem here?
Thanks in advance.
Re: Coloring Shapes in Maps in TeeChart v3.5.x.x
Posted: Fri Jul 24, 2009 3:54 pm
by 9644963
NarcĂs wrote:Hi Jon,
Could you please attach a simple example project or a code snippet we can run "as-is" to reproduce the problem here?
Thanks in advance.
Here's a test file/project. The data file needs to go into the same directory as the executable. The shapes are colored depending on the input data. I've also tried manually setting the color to a known color, or a range of colors. For some reason, I cannot do it.
Jon
[edit: file removed for the moment]
Re: Coloring Shapes in Maps in TeeChart v3.5.x.x
Posted: Fri Jul 24, 2009 4:55 pm
by 9644963
I've tried to color shapes for the map every way I can think of, but nothing seems to work, including the way it was done with v2.
Jon
Re: Coloring Shapes in Maps in TeeChart v3.5.x.x
Posted: Fri Jul 24, 2009 5:52 pm
by 9644963
OK, I was finally able to color the polygons, but the approach used in v2 did not work. I did this:
Code: Select all
poly.Add(data[0], data[1]);
poly.Add(data[2], data[3]);
poly.Add(data[4], data[5]);
poly.Add(data[6], data[7]);
int index = map1.Shapes.Add(poly);
map1.Colors[index] = Color.FromArgb((int)(red * 255), (int)(green * 255), (int)(blue * 255));
Unfortunately, the borders of each polygon are still visible.
Jon
Re: Coloring Shapes in Maps in TeeChart v3.5.x.x
Posted: Mon Jul 27, 2009 8:43 am
by narcis
Hi Jon,
I'm sorry but we are not sure about which is the exact problem here. Could you please attach a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.