Page 1 of 1

Hide chart background when printing

Posted: Tue Oct 18, 2011 12:32 pm
by 15660323
I am unable to hide the chart background when trying to print a chart with an applied theme.

For example if I use the theme BackInBlackTheme

Code: Select all

Steema.TeeChart.TChart T = new Steema.TeeChart.TChart();
Steema.TeeChart.Themes.BlackIsBackTheme CurrentTheme;
CurrentTheme = new Steema.TeeChart.Themes.BlackIsBackTheme(T.Chart);
CurrentTheme.Apply();
When I print the chart using T.Printer.Print the printout looks exactly like the chart on the screen (as expected).

However, i would like to print this chart using a transparent (or white) background so that the printout is more readable on a regular Black & White printer.

I tried changing the Theme of the chart before printing. But then i have to reset the Theme to the original after printing.

I wonder if there is a way to just hide the chart background in the trend when printing out.

Re: Hide chart background when printing

Posted: Wed Oct 19, 2011 9:29 am
by 10050769
Hello autarch,

A good option for you may be use auxiliary Chart. You can change its theme and print this auxiliary, without changes in the origianal Chart. You could do something as next:

Code: Select all

Steema.TeeChart.TChart tChart2 = new Steema.TeeChart.TChart();
            tChart2.Chart=tChart1.Chart;
            Steema.TeeChart.Themes.TeeChartTheme CurrentTheme;
            CurrentTheme = new Steema.TeeChart.Themes.TeeChartTheme(tChart2.Chart);
            CurrentTheme.Apply();
            tChart2.Printer.Print();
Can you please, tell us if previous code works fine for you?

I hope will helps.

Thanks,

Re: Hide chart background when printing

Posted: Fri Oct 21, 2011 12:37 pm
by 15660323
Thanks! The solution worked!

I only had to change one thing.

Code: Select all

tChart2.Chart=(Chart)tChart1.Chart.Clone();
Otherwise the theme would be applied to the chart which i was not printing as well.

Re: Hide chart background when printing

Posted: Wed Oct 26, 2011 7:30 am
by 10050769
Hello autarch,

I am glad that the solution works as you want :).

Thanks,