How do I show an empty chart when I have no data?If I try to bind an empty data set I get a message in place of the chart that says "I need at least 2 columns and 1 row"
If I don't bind anything I get a message in place of the chart that says "Data Not available. Please call Ultrachart.data.databind()"
If there is no data I just want an empty chart and it's not obvious on how to do that.
Thanks
Hello Scott Snyder,
Thank you for contacting us.
Could you please have a look at the references below regarding empty data display and Null data handling. I hope that you will find them helpful.
If I am missing something from your scenario, please let me know.
References:
http://es.infragistics.com/samples/aspnet/chart/empty-data-display
http://es.infragistics.com/samples/aspnet/chart/null-data-handling
Looking forward to hearing frmo you.
Those 2 examples look like it only handles what to do when your data set contains null values. In my case I have a completely empty data set. What I would like is when I have an empty data set to just show an empty chart. What I am getting instead is an error message that is displayed in place of the chart.
Hello,
If you want to show empty Chart my suggestion is to set EmptyChartText to " ".
Code snippet:
Looking forward to hearing from you.
That makes the chart invisible. I still want to see the axis and any grid lines.
Hi,
When there is no data that can be used from the chart, it is not possible to show axis or lines. When the data source is null by design the chart is showing message that can be set from the property EmptyChartText. If the chart shows axis and lines, when the data source is null, this will confuse the end user if indeed there is data to be shown or not.
Let me know if I may be of further assistance.
That is unfortunate. I really don't like having in big red text that there no data to plot instead of the chart. It makes it look like there is an error in the page when there is not.
Ok, this is a dumb answer, but it should work. When loading the chart, check to see if there is data, and if not hide the chart completely, and replace it with an image of the chart where you've erased all the data lines. A real kludge, but should work.
Chuck Snyder