How to hide empty graph

Stimulsoft Reports.WPF discussion
Post Reply
Arrow
Posts: 3
Joined: Tue Oct 08, 2013 3:28 pm

How to hide empty graph

Post by Arrow »

Hi,
How can i hide an empty graph?
is there a property i overlooked or should i use the beforeprint event to check if the graph is empty to set the visible property (what check?)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to hide empty graph

Post by HighAley »

Hello.

There is no special property to hide empty chart. You could try to check if there data for it in the BeforePrint event.

Thank you.
Arrow
Posts: 3
Joined: Tue Oct 08, 2013 3:28 pm

Re: How to hide empty graph

Post by Arrow »

thanks for the quick reply!
But how do I check if there is data in the graph?
Arrow
Posts: 3
Joined: Tue Oct 08, 2013 3:28 pm

Re: How to hide empty graph

Post by Arrow »

I found it! It was so easy after all... --> Good tool!

if (Chartname.Count == 0)
Chartname.Enabled=false;

or even shorter:

Chartname.Enabled=(Chartname.Count != 0)

THNX!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to hide empty graph

Post by HighAley »

Hello.

As a way you could write next expression in the Highlight Conditions and uncheck Enabled option there.

Code: Select all

Chartname.Count == 0
Thank you.
Post Reply