Page 1 of 1
AreaSeries - load from template
Posted: Wed Nov 05, 2008 7:14 pm
by 14045174
When I save area series into a template and then load it, border lines and area lines are not fully restored (they lose their colors). Same is true for some other pen objects (like lines in the LinePoints series).
Posted: Thu Nov 06, 2008 9:44 am
by narcis
Hi Profitstar,
Code below works fine for me here using latest TeeChart for .NET v3 release available at the client area. Can you please test if it works fine for you and, if necessary, modify it so that we can reproduce the issue here?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private System.IO.MemoryStream stream;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Area area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
area1.FillSampleValues();
area1.AreaLines.Color = Color.Red;
area1.LinePen.Color = Color.Lime;
Steema.TeeChart.Styles.LinePoint linePoint1 = new Steema.TeeChart.Styles.LinePoint(tChart1.Chart);
linePoint1.FillSampleValues();
linePoint1.LinePen.Color = Color.Blue;
linePoint1.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
stream = new System.IO.MemoryStream();
tChart1.Export.Template.Save(stream);
}
private void button1_Click(object sender, EventArgs e)
{
stream.Position = 0;
tChart1.Clear();
tChart1.Import.Template.Load(stream);
}
Thanks in advance.
Posted: Mon Nov 10, 2008 3:25 pm
by 14045174
Try this code - it produces 2 different looking graphs:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private MemoryStream stream;
private void InitializeChart()
{
TChart chart = new TChart();
Area area = new Area(chart.Chart);
area.Color = Color.DarkMagenta;
area.AreaLines.Color = Color.YellowGreen;
area.AreaLines.Visible = true;
area.AreaLines.Width = 2;
area.LinePen.Color = Color.YellowGreen;
area.LinePen.Visible = true;
area.LinePen.Width = 2;
area.FillSampleValues();
stream = new System.IO.MemoryStream();
chart.Export.Template.Save(stream);
}
private void button1_Click(object sender, EventArgs e)
{
stream.Position = 0;
tChart1.Clear();
tChart1.Import.Template.Load(stream);
}
Posted: Mon Nov 10, 2008 4:09 pm
by narcis
Hi Profitstar,
Thanks for the code. I could reproduce the issue here now and added it (TF02013556) to the defect list to be fixed for next releases.