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
can't retrieve all the map polygon plot with .ten file
Re: can't retrieve all the map polygon plot with .ten file
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,
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 |
Instructions - How to post in this forum |
Re: can't retrieve all the map polygon plot with .ten file
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();
}
//////////////////////////////////////////////////////
// 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
Sandra,
The following two pictures are what is when i press button 1 (draw and save .ten file) and button2 (load .ten file)
The following two pictures are what is when i press button 1 (draw and save .ten file) and button2 (load .ten file)
Re: can't retrieve all the map polygon plot with .ten file
The picture for load the .ten file.
Re: can't retrieve all the map polygon plot with .ten file
Hello Andra,
Did you test the code I posted?
Thanks,
Hookem
Did you test the code I posted?
Thanks,
Hookem
Re: can't retrieve all the map polygon plot with .ten file
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,
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 |
Instructions - How to post in this forum |
Re: can't retrieve all the map polygon plot with .ten file
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
Thanks,
Hookem
-
- 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
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.
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 |
Instructions - How to post in this forum |