Page 1 of 1

Polygon Plotting issues in webchart (.NET 2.0)

Posted: Tue Sep 19, 2006 12:33 am
by 9525970
Hello,

I have this problem where I cannot plot a Polygon inside WebChart, Can anyone please let me know what I am doing wrong here, this is a simple example with the default.aspx having the following code, I can see a empty chart but no Polygon

public partial class _Default : System.Web.UI.Page
{
Steema.TeeChart.Chart tchart;
protected void Page_Load(object sender, EventArgs e)
{

tchart=WebChart1.Chart;
Steema.TeeChart.Styles.Map map1 = new Steema.TeeChart.Styles.Map(tchart);
Steema.TeeChart.Styles.Polygon P1 = new Steema.TeeChart.Styles.Polygon(tchart);
P1.Add(100.2, 100.2);
P1.Add(200.2, 200.2);
P1.Add(300.2, 300.3);
P1.Add(150.5, 150.5);
P1.Add(100.2, 100.2);
map1.Shapes.Add(P1);
P1.ParentSeries = map1;
}
}

Also I am successfully using AddShape method in map series to draw polygons, but the limitation for AddShape method is it takes only integer values. I am trying to use Polygon series so that I can use floating point co-ordinates.

Thanks

Posted: Tue Sep 19, 2006 10:19 am
by narcis
Hi am,

You should use AddPolygon as in the example. You can also use AddPolygon with doubles ass the Add method used there also admits doubles,

Posted: Tue Sep 19, 2006 4:18 pm
by 9525970
Hello,

Can you post a small snippet of the code ? Which example are you talking about ?

Thanks

Posted: Wed Sep 20, 2006 7:56 am
by narcis
Hi am,

I thought you had already seen the example. It is the All Features\Welcome !\Chart styles\Extended\Map GIS example in the features demo, which is available at TeeChart's program group. The example already includes its sources.

Posted: Sun Nov 25, 2007 8:47 am
by 9643419
Hello Narcis,

I try result is the same as am,but I use window form chart.
The Map GIS example is use z vale,you can try below code.
The shape only display integer value.

Steema.TeeChart.Styles.Map map1 = new Steema.TeeChart.Styles.Map(tchart);
Steema.TeeChart.Styles.Polygon P1 = new Steema.TeeChart.Styles.Polygon(tchart);
P1.Add(100.2, 100.2);
P1.Add(200.2, 200.2);
P1.Add(300.2, 300.3);
P1.Add(150.5, 150.5);
P1.Add(100.2, 100.2);
map1.Shapes.Add(P1);

Posted: Mon Nov 26, 2007 10:25 am
by narcis
Hi wilcohsu

Have you tried the suggestion I made in my first reply to this thread? Does it work fine for you?

Thanks in advance.

Posted: Wed Nov 28, 2007 12:56 am
by 9643419
Hi,

That is not precise.
I think that will use integate value to replace double value.
Does it right?

Posted: Wed Nov 28, 2007 8:06 am
by narcis
Hi wilcohsu,

Yes, there's no problem on doing this.