Hide chart background when printing

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
autarch
Newbie
Newbie
Posts: 2
Joined: Fri Sep 30, 2011 12:00 am

Hide chart background when printing

Post by autarch » Tue Oct 18, 2011 12:32 pm

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.

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

Re: Hide chart background when printing

Post by Sandra » Wed Oct 19, 2011 9:29 am

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,
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

autarch
Newbie
Newbie
Posts: 2
Joined: Fri Sep 30, 2011 12:00 am

Re: Hide chart background when printing

Post by autarch » Fri Oct 21, 2011 12:37 pm

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.

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

Re: Hide chart background when printing

Post by Sandra » Wed Oct 26, 2011 7:30 am

Hello autarch,

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

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

Post Reply