TeeChart v6... Add Polygons In Map Chart

TeeChart for ActiveX, COM and ASP
Post Reply
Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

TeeChart v6... Add Polygons In Map Chart

Post by Quest » Mon Feb 18, 2008 7:51 am

My TeeChart version is Pro v6 ActiveX.
Could you provide sample codes about how can I add polygons in Map chart with c# language ?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 18, 2008 10:35 am

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Tue Feb 19, 2008 1:40 am

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);

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 19, 2008 9:25 am

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);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Thu Feb 21, 2008 3:33 am

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 ?

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

00

Post by Quest » Thu Feb 21, 2008 4:01 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 21, 2008 10:02 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Mon Feb 25, 2008 1:06 am

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 ?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 04, 2008 10:13 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Tue Mar 04, 2008 10:34 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 04, 2008 10:45 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Wed Mar 05, 2008 12:28 am

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.

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Wed Mar 05, 2008 4:05 am

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.

Quest
Newbie
Newbie
Posts: 9
Joined: Thu Sep 02, 2004 4:00 am
Contact:

Post by Quest » Thu Mar 06, 2008 12:57 am

Hi Narcís,

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Mar 06, 2008 10:55 am

Hi Quest,

Yes, this is not supported in v6. This feature was implemented for TeeChart Pro v8 ActiveX.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply