And adding various shapes in the map series using polygon class. See the below code:
Code: Select all
private void PlotCurve(ArrayList coordinates, Color clr)
{
Polygon pgon = null;
int count = coordinates.Count;
for (int i = 0; i < count; )
{
pgon = new Polygon (map1.Shapes, tChart1.Chart);
double[] values =(double[])coordinates[i];
pgon.Add(values[0], values[1]);
++i;
if(i<count)
{
values =(double[])coordinates[i];
pgon.Add(values[0], values[1]);
}
++i;
if(i<count)
{
values =(double[])coordinates[i];
pgon.Add(values[0], values[1]);
int index = map1.Shapes.Add(pgon);
map1.ColorEach = true;
map1.Shapes[index].ParentBrush=false;
map1.Shapes[index].Color = clr;
map1.Shapes[index].Pen.Color = clr;
--i;
}
}
map1.Shapes[index].Pen.Color = clr;
But this does not seem to do anything.
Instead if i use:
map1.Pen.Color it works, but that does not serve my purpose since all the shapes added will have the same color.
How to get around this problem?
Thanks