Page 1 of 1

TeeChart v6... Add Polygons In Map Chart

Posted: Mon Feb 18, 2008 7:51 am
by 9338841
My TeeChart version is Pro v6 ActiveX.
Could you provide sample codes about how can I add polygons in Map chart with c# language ?

Posted: Mon Feb 18, 2008 10:35 am
by narcis
Hi Quest,

I'm sorry but we don't have any C# example using TeeChart Pro ActiveX for that at the moment.

Anyway, at the forums threads below you'll find several examples. You shouldn't have any problem porting them to C#.

http://www.teechart.net/support/viewtop ... ap+polygon
http://www.teechart.net/support/viewtop ... ap+polygon
http://www.teechart.net/support/viewtop ... ap+polygon

Posted: Tue Feb 19, 2008 1:40 am
by 9338841
Hi Narcis,

Thanks for your reply.
I tried to wrote it as below, but it can not display any polygon besides Marks.
What's something wrong?

TeeChart.TChart chart = new TeeChart.TChartClass();
chart.AddSeries(TeeChart.ESeriesClass.scMap);
TeeChart.ISeries oSeries = chart.Series(0);
oSeries.Marks.Visible = true;
oSeries.asMap.Shapes.Add();
oSeries.asMap.Shapes.get_Polygon(0).Text = "Test";
oSeries.asMap.Shapes.get_Polygon(0).AddXY(0, 0);
oSeries.asMap.Shapes.get_Polygon(0).AddXY(0, 10);
oSeries.asMap.Shapes.get_Polygon(0).AddXY(10, 10);
oSeries.asMap.Shapes.get_Polygon(0).AddXY(10, 0);

Posted: Tue Feb 19, 2008 9:25 am
by narcis
Hi Quest,

It works fine for me here using TeeChart Pro v8.0.0.3 ActiveX. It may help you visualize the polygon adding following code:

Code: Select all

			chart.Axis.Left.MinimumOffset = 20;
			chart.Axis.Left.MaximumOffset = 20;
			chart.Axis.Bottom.MinimumOffset = 20;
			chart.Axis.Bottom.MaximumOffset = 20;
Or this:

Code: Select all

			chart.Axis.Left.SetMinMax(-5, 15);
			chart.Axis.Bottom.SetMinMax(-5, 15);

Posted: Thu Feb 21, 2008 3:33 am
by 9338841
Hi Narcis,

I tried it, but can not visualize the polygon yet.
The Marks is always at 0,0 whatever the location of polygon.
Any setting I should append using v6.0.0.3 ?

00

Posted: Thu Feb 21, 2008 4:01 am
by 9338841
Hi Narcis,

When I used the FillSampleValues method, the result is the same...
1. It can not display polygons beside Marks.
2. All Marks at the same location.

Posted: Thu Feb 21, 2008 10:02 am
by narcis
Hi Quest,

First of all, please notice there are newer TeeChart Pro v6 ActiveX releases available at the client download area. Could you please try using latest version available?

If problems persist, could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Mon Feb 25, 2008 1:06 am
by 9338841
Hi Narcís,

When I updated the newest version of TeeChart Pro v6, the web page displayed the exception "Can not generate ActiveX control xxx, because the current thread is not the single thread Apartment." at runtime.
Could you tell me how to solve the issue, please ?

Posted: Tue Mar 04, 2008 10:13 am
by narcis
Hi Quest,

Could you please read this thread? It may be a similar issue to yours. If you think it's the same problem please let us know, otherwise send us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Tue Mar 04, 2008 10:34 am
by 9338841
Hi Narcís,
For the thread issue, I found the answer finally. It should set ASPCompat be true in .aspx.
Based on the example at Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual Studio .NET\CSharpWebForm, could you tell me how to draw a LIVE chart (not a picture)? I tried it in many way, but not get a correct result.

Posted: Tue Mar 04, 2008 10:45 am
by narcis
Hi Quest,

You should do as in the example at C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual Studio .NET\VBWebForm.

Posted: Wed Mar 05, 2008 12:28 am
by 9338841
Hi Narcís,

Based on the VBWebForm example, I translated into C# as below:

Code: Select all

WebForm1.aspx.cs

TeeChart.TChartClass TChart1 = new TeeChart.TChartClass();
TChart1.AddSeries(TeeChart.ESeriesClass.scMap);
TChart1.Series(0).FillSampleValues(10);			
Response.BinaryWrite((byte[])TChart1.Export.asNative.SaveToStream(true));


WebForm2.aspx

<script language="VBScript">
  sub window_onload()
     Form1.TChart1.Import.LoadFromURL("http://localhost/TeeMap/WebForm1.aspx")			
  end sub
</script>
But I got a script error - "Out of memory" in WebForm2.aspx.

Posted: Wed Mar 05, 2008 4:05 am
by 9338841
Hi Narcís,

Status update...
I dropped all codes beside <%@ Page ... %> in WebForm1.aspx, it will not show "Out of memory".

In the code that my latest posted, it can work normally if I use Export.asPNG. But it display nothing if I use Export.asNative.

Posted: Thu Mar 06, 2008 12:57 am
by 9338841
Hi Narcís,

In the code that my latest posted, only the Map series will display nothing using Native exporting.
:(

Posted: Thu Mar 06, 2008 10:55 am
by narcis
Hi Quest,

Yes, this is not supported in v6. This feature was implemented for TeeChart Pro v8 ActiveX.