ChartBrush serialization problem

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

ChartBrush serialization problem

Post by UserLS » Sat Mar 27, 2010 4:36 am

Here are the steps to reproduce problem (it exists in both v3 and v2009):
  • For any shape (let's say Header) set the brush to use a pattern (any).
  • Then, let's say, you did not like it, so you set it back to solid color. So far so good.
  • Now, save this graph into a template file and then reload it. => Your patterns are back!
There is no way to get rid of these patterns, once they are being set. It is even more strange with walls, using dark 3D option. I did manage to "remove" patterns by setting both background color and foreground color to the same value, but not the sides! They are still showing patterns.

This is a huge problem for us, since our graphs are always saved into a template file and then included into reports.

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

Re: ChartBrush serialization problem

Post by Sandra » Mon Mar 29, 2010 11:23 am

Hello UserLs

I could reproduce your problem here and I have added it in bug report list with number [TF02014758]. We will try to fix it for next versions 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

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

Re: ChartBrush serialization problem

Post by Sandra » Wed Jun 16, 2010 10:46 am

Hello UserLs,


I communicate that it bug (TF02014758) works correctly now and it should work as expected in the next maintenance release.

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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: ChartBrush serialization problem

Post by UserLS » Tue Apr 24, 2012 7:13 pm

Any idea when this bug is going to be fixed? I have never seen it working since moving to .NET (even though you said it was fixed). If it was fixed in the past - then it is broken again. In the latest version still all the shapes and series will restore the pattern after reloading a template file...

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

Re: ChartBrush serialization problem

Post by Sandra » Wed Apr 25, 2012 3:13 pm

Hello UserLs,

I can not reproduce your problem using next code and last version of TeeChartFor.Net:

Code: Select all

  public Form1()
        {
            InitializeComponent();
            CreateCharts();
            InitializeChart();
        }

     
        private ChartController controller;

        private void CreateCharts()
        {
            tChart1.Dock = DockStyle.Fill;
            controller = new ChartController();
            controller.Chart = tChart1;
            this.Controls.Add(controller);
            tChart2.Dock = DockStyle.Fill;
        }

        private void InitializeChart()
        {
            tChart1.Header.Transparent = false;
            tChart1.Header.Brush.Visible = true;
            tChart1.Header.Brush.Color = Color.Red;
            tChart1.Header.Brush.ForegroundColor = Color.Yellow;
            tChart1.Header.Brush.Solid = false;
            tChart1.Header.Brush.Style = System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            tChart1.Header.Brush.Solid = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            tChart1.Export.Template.Save(ms);
            ms.Position = 0;
            tChart2.Import.Template.Load(ms);
        }
Can you check if in previous code your problem appears?

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

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Re: ChartBrush serialization problem

Post by UserLS » Wed Apr 25, 2012 4:41 pm

Code: Select all

            tChart1 = new TChart { Dock = DockStyle.Fill };
            Controls.Add(tChart1);

            var area = new Area(tChart1.Chart);
            area.Add(1, 15);
            area.Add(2, 11);
            area.Add(3, 18);
            area.Add(4, 16);

            area.AreaBrush.Style = HatchStyle.DiagonalCross;
            area.AreaBrush.Solid = true;

            tChart1.Header.Transparent = false;
            tChart1.Header.Brush.ForegroundColor = Color.White;
            tChart1.Header.Brush.Style = HatchStyle.DiagonalCross;
            tChart1.Header.Brush.Solid = true;

            var stream = new MemoryStream();
            tChart1.Export.Template.Save(stream );
            stream .Position = 0;
            tChart1.Import.Template.Load(stream );
After running this code I get area and header with patterns... Why?

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

Re: ChartBrush serialization problem

Post by Sandra » Mon Apr 30, 2012 2:27 pm

Hello UserLs,

I inform you that we can reproduce this problem and we have fixed it for next maintenance release.

Thanks for your information.
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

Post Reply