Page 1 of 1

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

Posted: Tue May 04, 2010 4:00 pm
by 9641422
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

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

Posted: Wed May 05, 2010 9:05 am
by 10050769
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,

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

Posted: Wed May 05, 2010 2:39 pm
by 9641422
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();
}

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

Posted: Wed May 05, 2010 2:53 pm
by 9641422
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 12749 times

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

Posted: Wed May 05, 2010 2:54 pm
by 9641422
The picture for load the .ten file.
load.JPG
load.JPG (58.7 KiB) Viewed 12733 times

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

Posted: Thu May 06, 2010 3:42 pm
by 9641422
Hello Andra,

Did you test the code I posted?

Thanks,

Hookem

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

Posted: Fri May 07, 2010 10:56 am
by 10050769
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,

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

Posted: Fri May 07, 2010 2:24 pm
by 9641422
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

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

Posted: Fri May 07, 2010 2:27 pm
by narcis
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.