How can I detect if a chart will have no data?

Expand / Collapse
 

How can I detect if a chart will have no data?


QUESTION

How can I detect if a chart will have no data?

ANSWER

First you have to use the dataEngine to get a populated series collection. See: Q10392

Then, you can see if the series collection has series and if the series have elements.

[C#]

SeriesCollection sc = myDataEngine.GetSeries();
bool hasData = false;
if(sc.Count > 0)
{
    foreach(Series s in sc)
        if(s.Elements.Count != 0)
            hasData = true;
}
 

You may also control the 'no data' label by using:
Chart.NoDataLabel.Text = "..";



Rate this Article:
     

Add Your Comments


Comment require login or registration.

Details
Last Modified:Thursday, January 20, 2005
Last Modified By: Support
Type: HOWTO
Rated 3 stars based on 3 votes.
Article has been viewed 8,012 times.
Options