can't retrieve all the map polygon plot with .ten file

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

can't retrieve all the map polygon plot with .ten file

Post by Amol » Tue May 04, 2010 4:00 pm

Hello,

I encountered a problem with importing .ten file and displaying map polygons with teechart 2 for C#. The step I did:
(1) draw map and add different colors to different polygons
(2) add customer axis labels to left and bottom axes.
(3) Save the chart to .ten file before closing the form
(4) Next time open the .ten file
All I can see is blanket polygons without color or wrong colors in some polygons. My customer axis labels are all gone.

So is there anything wrong with importing and exporting the .ten file for map polygons? The save method gave me the correct chart if the series is line series.

Thanks,

Hookem

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Sandra » Wed May 05, 2010 9:05 am

Hello Hookem,

I couldn't reproduce your problem here.Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?

Thanks,
Best Regards,
Sandra Pazos / 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

Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Amol » Wed May 05, 2010 2:39 pm

Please try the following code:
//////////////////////////////////////////////////////
// button 1 used to draw map and save .ten file
private void button1_Click(object sender, EventArgs e)
{
tChart1.Series.RemoveAllSeries();
Steema.TeeChart.Styles.Map map1 = new Steema.TeeChart.Styles.Map();
tChart1.Series.Add(map1);
//map1.Brush.Color = System.Drawing.Color.Red;
map1.LabelMember = "Labels";
map1.Clear();
//AddSampleShapes(map1);
map1.Marks.Visible = true;
Color[] Colors;
Colors = new Color[] {
Color.Red,
Color.Green,
Color.Yellow,
Color.Silver
};
string[] sRight ={"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
};
string[] sLeft ={
"A",
"B",
"C",
"D",
};
int[] x = new int[4];
int[] y = new int[4];
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 9; j++)
{
x[0] = j;
x[1] = j + 1;
x[2] = j + 1;
x[3] = j;
y[0] = i;
y[1] = i;
y[2] = i + 1;
y[3] = i + 1;
AddShape(map1, x, y, Colors, "");
}
}
map1.Marks.Visible = false;
tChart1.Legend.Visible = false;
tChart1.Axes.Left.Labels.Items.Clear();
for (int i = 0; i < 4; i++)
{
tChart1.Axes.Left.Labels.Items.Add(i + 0.5, sLeft);
}
tChart1.Axes.Bottom.Labels.Items.Clear();
for (int i = 0; i < 9; i++)
{
tChart1.Axes.Bottom.Labels.Items.Add(i + 0.5, sRight);
}
tChart1.Export.Template.IncludeData = true;
tChart1.Export.Template.Save("x.ten");
}

private void AddShape(Steema.TeeChart.Styles.Map map1, int[] X, int[] Y, Color AColor, string Text)
{
Polygon toAdd = new Polygon(map1.Shapes, tChart1.Chart);
for (int t = X.GetLowerBound(0); t <= X.GetUpperBound(0); ++t)
{
toAdd.Add(X[t], Y[t]);
}
Random rnd = new Random();
int i = map1.Shapes.Add(toAdd);
map1.Shapes.ParentBrush = false;
map1.Shapes.Text = Text;
map1.Shapes.Color = AColor;
map1.Shapes.Z = rnd.Next(1000) / 1000.0;
}
///////////////////////////////////////////
//button2 used to load the .ten file
private void button2_Click(object sender, EventArgs e)
{
tChart1.Import.Template.Load("x.ten");
tChart1.Refresh();
}

Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Amol » Wed May 05, 2010 2:53 pm

Sandra,
The following two pictures are what is when i press button 1 (draw and save .ten file) and button2 (load .ten file)
draw.JPG
draw.JPG (50.15 KiB) Viewed 12751 times

Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Amol » Wed May 05, 2010 2:54 pm

The picture for load the .ten file.
load.JPG
load.JPG (58.7 KiB) Viewed 12735 times

Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Amol » Thu May 06, 2010 3:42 pm

Hello Andra,

Did you test the code I posted?

Thanks,

Hookem

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Sandra » Fri May 07, 2010 10:56 am

Hello Hookem,

I have tested your project, and in version 4 of TeeChart.Net works fine. But we have found a problem with export and I have added it in bug report list with number [TF02014851]. We will try to fix it for next maintenance release of TeeChart .Net

Thanks,
Best Regards,
Sandra Pazos / 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

Amol
Advanced
Posts: 176
Joined: Mon May 29, 2006 12:00 am

Re: can't retrieve all the map polygon plot with .ten file

Post by Amol » Fri May 07, 2010 2:24 pm

When will the fixed release version be available? We will demo our software to our client next Friday and I don't want them to see that we can't open a project properly.

Thanks,

Hookem

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

Re: can't retrieve all the map polygon plot with .ten file

Post by Narcís » Fri May 07, 2010 2:27 pm

Hi Hookem,

I'm sorry but I can't still provide an estimate date. TF02014851 issue has been logged into our bug tracking system today and has not been fixed yet. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's fixed on them.
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