Page 1 of 1

TeeChart.BackColor Property is not working...??

Posted: Tue Feb 01, 2011 8:13 am
by 8571714
Hi,

I am using TeeChart dll version 4.0.2009.62332, in my application I was trying to set the background color of the Chart.
So in that process, I set the BackColor property of TeeChart to Transparent and after that setting, I am not able to set BackColor property to any other color by using property window as well as through code.
Could you please help me out with this issue.

Regards,
Nitin

Re: TeeChart.BackColor Property is not working...??

Posted: Tue Feb 01, 2011 8:59 am
by narcis
Hi Nitin,

I could reproduce the issue here and added it (TF02015369) to the defect list to be investigated for next releases.

Re: TeeChart.BackColor Property is not working...??

Posted: Wed Feb 02, 2011 2:56 pm
by narcis
Hi Nitin,

We have been investigating the issue further and you should be using Panel.Transparent to set the transparency of the Chart Panel, which works fine as in this example:

Code: Select all

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

      private void InitializeChart()
      {
        this.BackColor = Color.Red;

        tChart1.Panel.Gradient.Visible = false;
        tChart1.Panel.Transparent = true;

        tChart1.Click += new EventHandler(tChart1_Click);
      }

      void tChart1_Click(object sender, EventArgs e)
      {
        tChart1.Panel.Transparent = false;
        tChart1.Panel.Color = Color.Blue;
      }

Re: TeeChart.BackColor Property is not working...??

Posted: Thu Feb 03, 2011 5:33 am
by 8571714
Hi Narcis,

Problem is I have changed the BackColor Property of TeeChart to Transparent using property window.
And after that I can't change it to some other color. I tired to change it to some other color in InitializeControl() method to SystemColor.Control and after that I can see the SystemColor.Control color set in property window, however when I tried to change the BackColor later in code to some other color it is not considering that and I can see while debuggin the application the Transparent color is comming as Name of the BackColor for the teechart. Same think is occuring in case if I set the teechart backcolor to transparent and even the panel and wall Transparent property set to True. i.e. the solution you told me.

you can duplicate this easily by setting the BackColor property to Transparent and later try to set it to other color by any mean.


Regards,
Nitin

Re: TeeChart.BackColor Property is not working...??

Posted: Thu Feb 03, 2011 11:01 am
by narcis
Hi Nitin,

Have you tried removing that setting in Form1.Designer.cs? If the problem persists can you please attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.

Re: TeeChart.BackColor Property is not working...??

Posted: Thu Feb 03, 2011 11:23 am
by 8571714
Narcis,

I am not able to attach file as maximum file sized allowed is 512 KB.
I tried by removing the line from the Designer in which backColor is set to Transparent but still not able to get the changed color.

have tried setting the BackColor to Transparent and then tried to set to any other color?

Thanks,
Nitin

Re: TeeChart.BackColor Property is not working...??

Posted: Thu Feb 03, 2011 11:56 am
by narcis
Hi Nitin,

You don't need to include bin and lib folders, we have the TeeChart assembly here :wink:. Just files in the root project folder and Properties folder. Doing so you should get a much lighter package to upload.

Thanks in advance.

Re: TeeChart.BackColor Property is not working...??

Posted: Thu Feb 03, 2011 12:17 pm
by 8571714
Please find the attachement.
password = password

Thanks,
Nitin

Re: TeeChart.BackColor Property is not working...??

Posted: Thu Feb 03, 2011 12:32 pm
by narcis
Hi Nitin,

That's because you set the line below at design-time in Form1.Designer.cs. Removing it makes the application work.

Code: Select all

          this.tChart1.Panel.Brush.Color = System.Drawing.Color.Transparent;
Alternatively you can use the code below at run-time:

Code: Select all

        private void button1_Click(object sender, EventArgs e)
        {
          tChart1.Panel.Transparent = false;
          tChart1.Panel.Gradient.Visible = false;
          tChart1.Panel.Brush.Transparency = 0;
          tChart1.Panel.Color = Color.Green;
        }

Re: TeeChart.BackColor Property is not working...??

Posted: Fri Feb 04, 2011 6:06 am
by 8571714
Thanks Narcis, this changes has sovled the issue.

Regards,
Nitin