TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
jonsberndt
- Newbie
- Posts: 19
- Joined: Wed May 02, 2007 12:00 am
Post
by jonsberndt » Thu Jul 23, 2009 11:25 pm
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
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Jul 24, 2009 11:31 am
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.
-
jonsberndt
- Newbie
- Posts: 19
- Joined: Wed May 02, 2007 12:00 am
Post
by jonsberndt » Fri Jul 24, 2009 3:54 pm
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]
Last edited by
jonsberndt on Fri Jul 24, 2009 5:53 pm, edited 1 time in total.
-
jonsberndt
- Newbie
- Posts: 19
- Joined: Wed May 02, 2007 12:00 am
Post
by jonsberndt » Fri Jul 24, 2009 4:55 pm
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
-
jonsberndt
- Newbie
- Posts: 19
- Joined: Wed May 02, 2007 12:00 am
Post
by jonsberndt » Fri Jul 24, 2009 5:52 pm
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
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Mon Jul 27, 2009 8:43 am
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.