Page 1 of 1
Issue Exporting Chart To Graphics
Posted: Wed Mar 31, 2010 2:18 am
by 15653335
Hello,
I am having an issue exporting a chart to a graphics file. Everything works as expected when the chart is on a form by itself, but when the chart is included in a tab control the chart panel always comes out black. I have a project to demonstrate, but it is too big to post; I would be happy to send via email.
Mark
Re: Issue Exporting Chart To Graphics
Posted: Wed Mar 31, 2010 12:28 pm
by 10050769
Hello Mark,
I have a project to demonstrate, but it is too big to post; I would be happy to send via email.
It doesn't necessary to add folders bin and obj. Please remove folders and try again to upload your project. If you doesn't achieve to attach project in the thread, you could add it to
upload page.
Thanks,
Re: Issue Exporting Chart To Graphics
Posted: Wed Mar 31, 2010 2:09 pm
by 15653335
Hello,
Thank you, attached is the project.
Mark
Re: Issue Exporting Chart To Graphics
Posted: Thu Apr 01, 2010 10:00 am
by 10050769
Hello MarkR,
I have found where the problem is. I you needs put Transparency=0. Please, change code of export button for next, and check if works as you want.
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
string strMoeGraphFilename = "TChartExport";
this.tChart1.Focus();
this.tChart1.BackColor = Color.White;
this.tChart1.Panel.Color = Color.White;
this.tChart1.Walls.Back.Color = Color.White;
this.tChart1.Panel.Transparency=0;
strMoeGraphFilename += ".bmp";
this.tChart1.Export.Image.Bitmap.ColorReduction = Steema.TeeChart.Export.BitmapFormat.BMPColorReduction.Default;
this.tChart1.Export.Image.Bitmap.Save(Application.StartupPath + "\\" + strMoeGraphFilename);
this.tChart1.BackColor = Color.Transparent;
this.tChart1.Panel.Visible = false;
this.tChart1.Walls.Back.Color = Color.Black;
this.tChart1.Walls.Back.Transparent = false;
this.tChart1.Walls.Back.Brush.Gradient.Visible = false;
}
I hope will helps.
Thanks,
Re: Issue Exporting Chart To Graphics
Posted: Thu Apr 01, 2010 12:31 pm
by 15653335
Sandra,
Thank you. You might have noticed that in my original code that I submitted I had this line commented out, I was trying to see if this would resolve the issue. Additionally, I had "this.tChart1.Panel.Transparent = false;" set in the constructor. Now the interesting part, when I set the "this.tChart1.Panel.Transparency = 0;" on my main development machine I get the background color to show correctly in the saved graphic file, but on my other office machine the panel still shows as black.
I will contine to look into this issue on my side to see if there is more information that I could provide to you to help decipher this issue. I am wondering if there is some rendering issues related to specific video cards?
Thanks,
Mark
Re: Issue Exporting Chart To Graphics
Posted: Thu Apr 01, 2010 1:15 pm
by narcis
Hi Mark,
I am wondering if there is some rendering issues related to specific video cards?
Not that we are aware of.