Page 1 of 1

Bug with serialization Format->Style

Posted: Fri Jun 23, 2006 4:08 pm
by 9640767
Hello All,

Format Style option doesn't reflected to the chart after deserialization (teechart 2.0.2306.26232):

1) add 2 charts to winform
2) create horizntal bar serier in tChart1
3) fill that serier with sample values
horizBar1.FillSampleValues();

4) raise teechart property
Steema.TeeChart.Editor editor = new Steema.TeeChart.Editor(tChart1);
editor.ShowModal();

5) go to Series->Format
modify Series->Format->Style to Rect. Gradient.

6) run next code
// save chart
BinaryFormatter serializer = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
serializer.Serialize(ms, tChart1);

// restore chart1 to chart2
BinaryFormatter serializer2 = new BinaryFormatter();
ms.Position = 0;
tChart2 = (TChart)serializer2.Deserialize(ms);

tChart2.Refresh();

As you can see the second chart doesn't have "Rect. Gradient." effects, but the property is still set!!

Any ideas how to eliminate it?

Thanks.

Posted: Mon Jun 26, 2006 10:38 am
by narcis
Hello,

It works fine for me here using the code below. Can you please test if it works at your end?

Code: Select all

    private Steema.TeeChart.Styles.HorizBar horizBar1;
    private void Form1_Load(object sender, EventArgs e)
    {
      horizBar1 = new Steema.TeeChart.Styles.HorizBar(tChart1.Chart);
      horizBar1.FillSampleValues();
    }

    MemoryStream ms;

    private void button1_Click(object sender, EventArgs e)
    {
      ms = new MemoryStream();
      tChart1.Export.Template.Save(ms);
    }

    private void button2_Click(object sender, EventArgs e)
    {
      ms.Position = 0;
      tChart2.Import.Template.Load(ms);
    }